]> wimlib.net Git - wimlib/commitdiff
split.c: fix finding extension of first split WIM part
authorEric Biggers <ebiggers3@gmail.com>
Wed, 28 Feb 2018 03:31:58 +0000 (19:31 -0800)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 28 Feb 2018 03:51:47 +0000 (19:51 -0800)
Silly old bug: wimlib_split() considered the first dot in the SWM path
to begin the filename extension.  But of course, there can be other dots
in the path; we need to look for the last dot in the last component.

NEWS
src/split.c

diff --git a/NEWS b/NEWS
index a2e812f431d8d6ace140633cd5cfa9f46f887013..5213d672f02089854c3077d46b98f0c4b97a8502 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,9 @@ Version 1.13.0-BETA:
        existing integrity tables.  This can be useful to avoid unwanted
        verification of large WIM files, e.g. WIMs given by '--delta-from'.
 
+       wimsplit (API: wimlib_split()) now correctly handles a dot in the path
+       to the first split WIM part, prior to the filename extension.
+
        'wimlib-imagex --version' now shows the version of the library it is
        actually using (in case it is different from wimlib-imagex's version).
 
index 795fb2cf4f269b7a6b3de6fb73613a749ffc959b..1313a59aa10ef03c36101ed99508db9206fc2034 100644 (file)
@@ -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));