canonicalize_fs_path(): Retain backslashes
authorEric Biggers <ebiggers3@gmail.com>
Mon, 20 May 2013 21:17:16 +0000 (16:17 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Mon, 20 May 2013 21:23:07 +0000 (16:23 -0500)
src/capture_common.c
src/paths.c

index e6b5baa45b521b3bbcd225e0fe4f119daebe3bb9..0a6ba44d2b98ea7f3c3a1be58e5b9ee889c97dc7 100644 (file)
@@ -67,6 +67,7 @@ canonicalize_pattern(const tchar *pat, tchar **canonical_pat_ret)
        canonical_pat = canonicalize_fs_path(pat);
        if (!canonical_pat)
                return WIMLIB_ERR_NOMEM;
        canonical_pat = canonicalize_fs_path(pat);
        if (!canonical_pat)
                return WIMLIB_ERR_NOMEM;
+       zap_backslashes(canonical_pat);
        *canonical_pat_ret = canonical_pat;
        return 0;
 }
        *canonical_pat_ret = canonical_pat;
        return 0;
 }
index b4576cc1026863d1bf9f178edb6bfba266b00041..040ed697c083537730a7acb278ab7a15e91fb25b 100644 (file)
@@ -89,18 +89,13 @@ zap_backslashes(tchar *s)
        }
 }
 
        }
 }
 
-/* Duplicate a path, with backslashes translated into forward slashes; return
- * empty string for NULL input. */
+/* Duplicate a path; return empty string for NULL input. */
 tchar *
 canonicalize_fs_path(const tchar *fs_path)
 {
 tchar *
 canonicalize_fs_path(const tchar *fs_path)
 {
-       tchar *canonical_path;
-
        if (!fs_path)
                fs_path = T("");
        if (!fs_path)
                fs_path = T("");
-       canonical_path = TSTRDUP(fs_path);
-       zap_backslashes(canonical_path);
-       return canonical_path;
+       return TSTRDUP(fs_path);
 }
 
 /* Duplicate a path, with backslashes translated into forward slashes; return
 }
 
 /* Duplicate a path, with backslashes translated into forward slashes; return