From: Eric Biggers Date: Mon, 20 May 2013 21:17:16 +0000 (-0500) Subject: canonicalize_fs_path(): Retain backslashes X-Git-Tag: v1.4.1~76 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=ebe0206c700963ee0ace86cc55fca6570b03cac3 canonicalize_fs_path(): Retain backslashes --- diff --git a/src/capture_common.c b/src/capture_common.c index e6b5baa4..0a6ba44d 100644 --- a/src/capture_common.c +++ b/src/capture_common.c @@ -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; } diff --git a/src/paths.c b/src/paths.c index b4576cc1..040ed697 100644 --- a/src/paths.c +++ b/src/paths.c @@ -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