Skip to content

Commit 5fffbbc

Browse files
committed
express: error if Windows-style path is used (LP 1429241)
1 parent 2e5051a commit 5fffbbc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

panda/src/express/virtualFileSystem.cxx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,24 @@ do_get_file(const Filename &filename, int open_flags) const {
12261226
}
12271227
}
12281228

1229+
#if defined(_WIN32) && !defined(NDEBUG)
1230+
if (!found_file) {
1231+
// The file could not be found. Perhaps this is because the user passed
1232+
// in a Windows-style path where a Unix-style path was expected?
1233+
if (filename.length() > 2 && isalpha(filename[0]) && filename[1] == ':' &&
1234+
(filename[2] == '\\' || filename[2] == '/')) {
1235+
1236+
Filename corrected_fn = Filename::from_os_specific(filename);
1237+
if (corrected_fn.exists()) {
1238+
express_cat.warning()
1239+
<< "Filename uses Windows-style path: " << filename << "\n";
1240+
express_cat.warning()
1241+
<< " expected Unix-style path: " << corrected_fn << "\n";
1242+
}
1243+
}
1244+
}
1245+
#endif
1246+
12291247
return found_file;
12301248
}
12311249

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy