Skip to content
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

wildmatch: ensure given patterns are POSIX-compliant #6

Merged
merged 3 commits into from
Feb 19, 2018

Conversation

ttaylorr
Copy link
Contributor

This pull request introduces slashEscape, which ensures that given paths are (pseudo) POSIX-compliant, while preserving the meaningfulness of escape sequences.

Wildmatch expects to perform pattern matching operations on POSIX-compliant paths (and mingw converts automatically [1]), but it is possible that the Windows command prompt does not do this.

To ensure correctness, convert to POSIX ourselves.

This pull request also removes three test cases that have behavior defined by the platform on which they are run. For instance, consider the test \a\b\c, which indicates a/b/c (in POSIX) on Windows, but on macOS is three invalid escape sequences. The behavior for these cases should be left undefined.

@ttaylorr ttaylorr merged commit 8a05186 into master Feb 19, 2018
@ttaylorr ttaylorr deleted the slash-escape branch February 19, 2018 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant