mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
express: error if Windows-style path is used (LP 1429241)
This commit is contained in:
parent
2e5051ac04
commit
5fffbbce47
@ -1226,6 +1226,24 @@ do_get_file(const Filename &filename, int open_flags) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(NDEBUG)
|
||||||
|
if (!found_file) {
|
||||||
|
// The file could not be found. Perhaps this is because the user passed
|
||||||
|
// in a Windows-style path where a Unix-style path was expected?
|
||||||
|
if (filename.length() > 2 && isalpha(filename[0]) && filename[1] == ':' &&
|
||||||
|
(filename[2] == '\\' || filename[2] == '/')) {
|
||||||
|
|
||||||
|
Filename corrected_fn = Filename::from_os_specific(filename);
|
||||||
|
if (corrected_fn.exists()) {
|
||||||
|
express_cat.warning()
|
||||||
|
<< "Filename uses Windows-style path: " << filename << "\n";
|
||||||
|
express_cat.warning()
|
||||||
|
<< " expected Unix-style path: " << corrected_fn << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return found_file;
|
return found_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user