mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
avoid low-level case-sensitive issues
This commit is contained in:
parent
352c901aa1
commit
ed32f2264e
@ -168,7 +168,9 @@ get_cwd() {
|
|||||||
assert(buffer != (char *)NULL);
|
assert(buffer != (char *)NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Filename::from_os_specific(buffer);
|
Filename cwd = Filename::from_os_specific(buffer);
|
||||||
|
cwd.make_true_case();
|
||||||
|
return cwd;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -413,12 +413,16 @@ from_os_specific(const string &os_specific, Filename::Type type) {
|
|||||||
// Access: Published, Static
|
// Access: Published, Static
|
||||||
// Description: Returns the same thing as from_os_specific(), but
|
// Description: Returns the same thing as from_os_specific(), but
|
||||||
// embedded environment variable references
|
// embedded environment variable references
|
||||||
// (e.g. "$DMODELS/foo.txt") are expanded out.
|
// (e.g. "$DMODELS/foo.txt") are expanded out. It also
|
||||||
|
// automatically elevates the file to its true case if
|
||||||
|
// needed.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
Filename Filename::
|
Filename Filename::
|
||||||
expand_from(const string &os_specific, Filename::Type type) {
|
expand_from(const string &os_specific, Filename::Type type) {
|
||||||
return from_os_specific(ExecutionEnvironment::expand_string(os_specific),
|
Filename file = from_os_specific(ExecutionEnvironment::expand_string(os_specific),
|
||||||
type);
|
type);
|
||||||
|
file.make_true_case();
|
||||||
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -164,6 +164,7 @@ reload_implicit_pages() {
|
|||||||
string prc_dir = ExecutionEnvironment::get_environment_variable(prc_dir_envvar_list[i]);
|
string prc_dir = ExecutionEnvironment::get_environment_variable(prc_dir_envvar_list[i]);
|
||||||
if (!prc_dir.empty()) {
|
if (!prc_dir.empty()) {
|
||||||
Filename prc_dir_filename = Filename::from_os_specific(prc_dir);
|
Filename prc_dir_filename = Filename::from_os_specific(prc_dir);
|
||||||
|
prc_dir_filename.make_true_case();
|
||||||
if (scan_auto_prc_dir(prc_dir_filename)) {
|
if (scan_auto_prc_dir(prc_dir_filename)) {
|
||||||
_search_path.append_directory(prc_dir_filename);
|
_search_path.append_directory(prc_dir_filename);
|
||||||
}
|
}
|
||||||
@ -188,6 +189,7 @@ reload_implicit_pages() {
|
|||||||
q = path.length();
|
q = path.length();
|
||||||
}
|
}
|
||||||
Filename prc_dir_filename = Filename::from_os_specific(path.substr(p, q - p));
|
Filename prc_dir_filename = Filename::from_os_specific(path.substr(p, q - p));
|
||||||
|
prc_dir_filename.make_true_case();
|
||||||
if (scan_auto_prc_dir(prc_dir_filename)) {
|
if (scan_auto_prc_dir(prc_dir_filename)) {
|
||||||
_search_path.append_directory(prc_dir_filename);
|
_search_path.append_directory(prc_dir_filename);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,9 @@ reload_search_path() {
|
|||||||
string expanded = ExecutionEnvironment::expand_string(decl->get_string_value());
|
string expanded = ExecutionEnvironment::expand_string(decl->get_string_value());
|
||||||
ExecutionEnvironment::clear_shadow("THIS_PRC_DIR");
|
ExecutionEnvironment::clear_shadow("THIS_PRC_DIR");
|
||||||
if (!expanded.empty()) {
|
if (!expanded.empty()) {
|
||||||
_cache.append_directory(Filename::from_os_specific(expanded));
|
Filename dir = Filename::from_os_specific(expanded);
|
||||||
|
dir.make_true_case();
|
||||||
|
_cache.append_directory(dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,13 @@ VirtualFileSystem *VirtualFileSystem::_global_ptr = NULL;
|
|||||||
VirtualFileSystem::
|
VirtualFileSystem::
|
||||||
VirtualFileSystem() :
|
VirtualFileSystem() :
|
||||||
vfs_case_sensitive
|
vfs_case_sensitive
|
||||||
("vfs-case-sensitive", true,
|
("vfs-case-sensitive",
|
||||||
|
#ifdef NDEBUG
|
||||||
|
false, // The default for a production build is not case-sensitive;
|
||||||
|
// this avoids runtime overhead to verify case sensitivity.
|
||||||
|
#else
|
||||||
|
true,
|
||||||
|
#endif
|
||||||
PRC_DESC("Set this true to make the VirtualFileSystem present the native "
|
PRC_DESC("Set this true to make the VirtualFileSystem present the native "
|
||||||
"OS-provided filesystem as if it were a case-sensitive file "
|
"OS-provided filesystem as if it were a case-sensitive file "
|
||||||
"system, even if it is not (e.g. on Windows). This variable "
|
"system, even if it is not (e.g. on Windows). This variable "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user