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 expect path
to be file.txt
. However, because the second (optional) argument to relative
is evaluated as C:\dev\working\directory
(capital 'C'), lexically_relative
will exit early on its first check and simply return a default-constructed path
.
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 a d:
and D:
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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4