canonicalize_fs_path(): Retain backslashes
[wimlib] / src / capture_common.c
index a18b49ca9e226740080920401152d51fb676bdea..0a6ba44d2b98ea7f3c3a1be58e5b9ee889c97dc7 100644 (file)
  * along with wimlib; if not, see http://www.gnu.org/licenses/.
  */
 
-#include "wimlib_internal.h"
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
 
-#include <string.h>
+#include "wimlib/assert.h"
+#include "wimlib/capture.h"
+#include "wimlib/error.h"
+#include "wimlib/paths.h"
 
 #ifdef __WIN32__
-#  include "win32.h"
+#  include "wimlib/win32.h" /* for fnmatch() equivalent */
 #else
 #  include <fnmatch.h>
 #endif
+#include <string.h>
+
 
 static int
 canonicalize_pattern(const tchar *pat, tchar **canonical_pat_ret)
@@ -60,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;
 }