Filemanager possible issue with case insensitivity in Windows #18367
Labels
bugzilla
Issues migrated from bugzilla
clang:to-be-triaged
Should not be used for new issues
platform:windows
Extended Description
In Windows, files are usually case insensitive. The program may not be able to change this, see
http://www.nicklowe.org/2012/02/understanding-case-sensitivity-in-windows-obcaseinsensitive-file_case_sensitive_search/
Meanwhile,
SeenFileEntries
keys inFileManager
are case-sensitive, so we may end up with duplicate mappings inSeenFileEntries
for the same file, for examplewill all map to the same
FileEntry
.Furthermore, the file name in FE will be the searched-for filename rather than the real filename. For example, let's say you have hello.h on disk but you searched for
HELLO.H
. Since stat succeeds withHELLO.H
this will be the filename linked from the FE and used in all clang's diagnostics.I'm not sure if this should be called a bug but it may not be what the user expects.
Fixing this would require extra work for every file open on Windows, using
FindFirstFile
looking for file instead of stat checking the file exists.Reid Kleckner comment on cfe-dev:
I think the correct design is to have multiple strings point to the same
FileEntry
, which owns the canonical name, rather than pointing to theStringMap
key used for the first path encountered.The text was updated successfully, but these errors were encountered: