haskell / haskell/filepath

normalise should not alter paths that start with \\?\

Open
#56 5 comments 0 reactions 0 assignees View on GitHub
discussion
Dominant language
Haskell
Stars
74
Forks
38
PR merge metrics
No merged PRs in 30d

Description

From https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx#maxpath :

> They indicate that the path should be passed to the system with minimal modification, which means that you cannot use forward slashes to represent path separators, or a period to represent the current directory, or double dots to represent the parent directory.

My take from this is that whenever `\\?\` is at the beginning of a path, then everything afterward must interpreted literally. Specifically:

- `/` should be understood as a normal character, not a path separator
- `.` and `..` should be understood as normal path segments, not special directories

This means whenever `normalise` sees a path that starts with `\\?\`, it should basically do nothing at all.

As of filepath-1.4.1.0, `normalise "\\\\?\\C:\\.\\Windows/" == "\\\\?\\C:\\Windows\\"`, which is incorrect according to MSDN. Instead, it should remain as is.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.