-
-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect slash substitution on Windows platform #64
Comments
Related: isaacs/node-glob#212 |
fyi - i've found some workarounds for escaping on Windows: and |
or a little bit simpler syntax would be |
Forward slash in glob pattern should match both forward and back slashes in filepath on Windows! |
In minimatch.js, function Minimatch back-slash characters in the pattern get replaced by forward-slashes when running on Windows platform. This isn't necessary since glob requires that only forward-slashes are used in paths. It is also wrong because patterns can contain back-slashes. For example it breaks 'npm help npm' on Windows (no man pages are found) because help.js, line 66 uses a pattern with a back-slash that mustn't be converted to a forward-slash (which is then interpreted as a path separator and breaks the pattern).
I suggest not to convert slashes in minimatch because it would be hard to distinguish slashes in paths from slashes in patterns but to leave path conversion to the caller, e.g.
var manroot = path.resolve(__dirname, "..", "man").split("\\").join("/")
in help.js, line 59.
The text was updated successfully, but these errors were encountered: