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

Fix Windows path handling and simplify path normalization. #751

Merged
merged 1 commit into from
Jan 25, 2017

Conversation

twistor
Copy link

@twistor twistor commented Jan 25, 2017

Issues:

  1. Just because a path contains a backslash, doesn't mean it's a Windows path. Backslashes are valid in file/directory names on Linux.
  2. Windows is fine using forward slashes for paths.
  3. The regex was hard to figure out. This, to me at least, is a lot simpler to follow.
  4. Added a test to check about removing null bytes.

Even though Linux supports backslashes, I haven't checked all the other adapters to see what they support. And, since backslashes are directory separators on Windows, we could wind up with different file structures if we allowed them. This seems like the lowest common denominator.

Also, I've merged normalizePath() and normalizeRelativePath() since I don't see a safe subset for normalizeRelativePath() to do, or how they are really different.

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.

2 participants