Case-Sensitivity For Windows Drive Letters #70
Labels
available on master
Fix is done on master branch, issue closed on next release
bug
Something isn't working
Milestone
Windows case-sensitivity for drive letters is not always interpreted correctly.
To Reproduce:
fs::path path = fs::relative("c:\\dev\\working\\directory\\file.txt");
Assuming the current working directory is
C:\dev\working\directory
, one would expectpath
to befile.txt
. However, because the second (optional) argument torelative
is evaluated asC:\dev\working\directory
(capital 'C'),lexically_relative
will exit early on its first check and simply return a default-constructedpath
.A fix for this specific issue could be to force drive letters to be capital, say, in
weakly_canonical
. Now, even Windows can't guarantee case-insensitivity for all file names, but I do believe that drive letters are case-insensitive -- for example, I don't think you can have ad:
andD:
drive mounted simultaneously. Additionally, under MSVC, it appears that path equality checks are completely case-insensitive when using the standard template library's file system implementation. This does not seem to be the case when compiling under any other compiler.The text was updated successfully, but these errors were encountered: