]> wimlib.net Git - wimlib/blobdiff - src/split.c
mount_image.c: add fallback definitions of RENAME_* constants
[wimlib] / src / split.c
index 795fb2cf4f269b7a6b3de6fb73613a749ffc959b..8205c71c577cc4d5fea0e2c1d4e74633f6fbb6a1 100644 (file)
@@ -18,7 +18,7 @@
  * details.
  *
  * You should have received a copy of the GNU Lesser General Public License
- * along with this file; if not, see http://www.gnu.org/licenses/.
+ * along with this file; if not, see https://www.gnu.org/licenses/.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -31,6 +31,7 @@
 #include "wimlib/error.h"
 #include "wimlib/list.h"
 #include "wimlib/metadata.h"
+#include "wimlib/paths.h"
 #include "wimlib/progress.h"
 #include "wimlib/resource.h"
 #include "wimlib/wim.h"
@@ -74,7 +75,7 @@ write_split_wim(WIMStruct *orig_wim, const tchar *swm_name,
        swm_name_len = tstrlen(swm_name);
        swm_name_buf = alloca((swm_name_len + 20) * sizeof(tchar));
        tstrcpy(swm_name_buf, swm_name);
-       dot = tstrchr(swm_name_buf, T('.'));
+       dot = tstrrchr(path_basename(swm_name_buf), T('.'));
        if (dot) {
                swm_base_name_len = dot - swm_name_buf;
                swm_suffix = alloca((tstrlen(dot) + 1) * sizeof(tchar));
@@ -95,7 +96,6 @@ write_split_wim(WIMStruct *orig_wim, const tchar *swm_name,
 
        for (part_number = 1; part_number <= swm_info->num_parts; part_number++) {
                int part_write_flags;
-               wimlib_progress_func_t progfunc;
 
                if (part_number != 1) {
                        tsprintf(swm_name_buf + swm_base_name_len,
@@ -117,8 +117,6 @@ write_split_wim(WIMStruct *orig_wim, const tchar *swm_name,
                if (part_number != 1)
                        part_write_flags |= WIMLIB_WRITE_FLAG_NO_METADATA;
 
-               progfunc = orig_wim->progfunc;
-               orig_wim->progfunc = NULL;
                ret = write_wim_part(orig_wim,
                                     progress.split.part_name,
                                     WIMLIB_ALL_IMAGES,
@@ -128,7 +126,6 @@ write_split_wim(WIMStruct *orig_wim, const tchar *swm_name,
                                     swm_info->num_parts,
                                     &swm_info->parts[part_number - 1].blob_list,
                                     guid);
-               orig_wim->progfunc = progfunc;
                if (ret)
                        return ret;