mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 15:25:54 -04:00
dtoolutil/express: Resolving empty filename should yield no result
See #1140 - I may revert this if someone can demonstrate a compelling use case (for current directory, you can use "." instead), but it seems to have the potential to cause unintuitive behavior.
This commit is contained in:
parent
47f35a287c
commit
e9e1bb1bc6
@ -242,6 +242,10 @@ get_directory(size_t n) const {
|
||||
*/
|
||||
Filename DSearchPath::
|
||||
find_file(const Filename &filename) const {
|
||||
if (filename.empty()) {
|
||||
return string();
|
||||
}
|
||||
|
||||
if (filename.is_local()) {
|
||||
if (_directories.empty()) {
|
||||
// Let's say an empty search path is the same as a search path
|
||||
|
@ -649,6 +649,10 @@ find_file(const Filename &filename, const DSearchPath &searchpath,
|
||||
return get_file(filename, status_only);
|
||||
}
|
||||
|
||||
if (filename.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int num_directories = searchpath.get_num_directories();
|
||||
for (int i = 0; i < num_directories; ++i) {
|
||||
Filename match(searchpath.get_directory(i), filename);
|
||||
|
Loading…
x
Reference in New Issue
Block a user