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 e6b5baa..0a6ba44 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;
+       zap_backslashes(canonical_pat);
        *canonical_pat_ret = canonical_pat;
        return 0;
 }
index b4576cc..040ed69 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 *canonical_path;
-
        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