Warn on filesystem case mismatch
When a file is opened with a wrong case, it can work on the developer system but break on a user system with a case-sensitive filesystem. This will display a warning when it happens. CAVEATS: It will also display the warning if a symlink is in the path. Adapt warning if the file is a symlink. Avoid warning on symlinks. Fix memory leak and avoid `lstat` usage. Avoid exposing real_path when not in TOOLS_ENABLED mode.
This commit is contained in:
committed by
K. S. Ernest (iFire) Lee
parent
87318a2fb7
commit
c09731c413
@@ -127,7 +127,7 @@ Error FileAccessWindows::open_internal(const String &p_path, int p_mode_flags) {
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
// Windows is case insensitive, but all other platforms are sensitive to it
|
||||
// Windows is case insensitive in the default configuration, but other platforms can be sensitive to it
|
||||
// To ease cross-platform development, we issue a warning if users try to access
|
||||
// a file using the wrong case (which *works* on Windows, but won't on other
|
||||
// platforms), we only check for relative paths, or paths in res:// or user://,
|
||||
|
||||
Reference in New Issue
Block a user