From f90f74c9649bacf17f84d5b8bef082eaa2260803 Mon Sep 17 00:00:00 2001 From: Brandon Martinez Date: Thu, 28 Apr 2016 14:33:54 -0400 Subject: [PATCH] Standardize Path Names for readdir Different clients will use different characters for path delimiting (e.g. the Windows command line FTP client uses \ instead of /).Standardize on / to ease wildcard lookup. --- lib/glob.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/glob.js b/lib/glob.js index e6805aa..fa9b29c 100644 --- a/lib/glob.js +++ b/lib/glob.js @@ -84,6 +84,9 @@ function matchPattern(pattern, string) { } function glob(path, fsm, callback, noWildcards) { + // Standardize path for wildcard lookup + path = path.replace(/\\/gi, '/') + var w; for (w = 0; !noWildcards && w < path.length && path.charAt(w) !== '*' && path.charAt(w) !== '?'; ++w) {