diff --git a/dtool/src/dtoolutil/executionEnvironment.cxx b/dtool/src/dtoolutil/executionEnvironment.cxx index 186ea8ba70..d7975bcc29 100644 --- a/dtool/src/dtoolutil/executionEnvironment.cxx +++ b/dtool/src/dtoolutil/executionEnvironment.cxx @@ -168,7 +168,9 @@ get_cwd() { assert(buffer != (char *)NULL); } - return Filename::from_os_specific(buffer); + Filename cwd = Filename::from_os_specific(buffer); + cwd.make_true_case(); + return cwd; } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/dtoolutil/filename.cxx b/dtool/src/dtoolutil/filename.cxx index 04c94b0f54..199591158f 100644 --- a/dtool/src/dtoolutil/filename.cxx +++ b/dtool/src/dtoolutil/filename.cxx @@ -413,12 +413,16 @@ from_os_specific(const string &os_specific, Filename::Type type) { // Access: Published, Static // Description: Returns the same thing as from_os_specific(), but // 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:: expand_from(const string &os_specific, Filename::Type type) { - return from_os_specific(ExecutionEnvironment::expand_string(os_specific), - type); + Filename file = from_os_specific(ExecutionEnvironment::expand_string(os_specific), + type); + file.make_true_case(); + return file; } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/prc/configPageManager.cxx b/dtool/src/prc/configPageManager.cxx index 2dd6750822..f8929e4d5d 100644 --- a/dtool/src/prc/configPageManager.cxx +++ b/dtool/src/prc/configPageManager.cxx @@ -164,6 +164,7 @@ reload_implicit_pages() { string prc_dir = ExecutionEnvironment::get_environment_variable(prc_dir_envvar_list[i]); if (!prc_dir.empty()) { Filename prc_dir_filename = Filename::from_os_specific(prc_dir); + prc_dir_filename.make_true_case(); if (scan_auto_prc_dir(prc_dir_filename)) { _search_path.append_directory(prc_dir_filename); } @@ -188,6 +189,7 @@ reload_implicit_pages() { q = path.length(); } 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)) { _search_path.append_directory(prc_dir_filename); } diff --git a/dtool/src/prc/configVariableSearchPath.cxx b/dtool/src/prc/configVariableSearchPath.cxx index 35115a2e68..85d8a732a4 100644 --- a/dtool/src/prc/configVariableSearchPath.cxx +++ b/dtool/src/prc/configVariableSearchPath.cxx @@ -39,7 +39,9 @@ reload_search_path() { string expanded = ExecutionEnvironment::expand_string(decl->get_string_value()); ExecutionEnvironment::clear_shadow("THIS_PRC_DIR"); 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); } } diff --git a/panda/src/express/virtualFileSystem.cxx b/panda/src/express/virtualFileSystem.cxx index 91b611f432..c5ad698078 100644 --- a/panda/src/express/virtualFileSystem.cxx +++ b/panda/src/express/virtualFileSystem.cxx @@ -36,7 +36,13 @@ VirtualFileSystem *VirtualFileSystem::_global_ptr = NULL; VirtualFileSystem:: VirtualFileSystem() : 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 " "OS-provided filesystem as if it were a case-sensitive file " "system, even if it is not (e.g. on Windows). This variable "