Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicated folder reference in Godot Editor after changing filename case #90280

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions editor/editor_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,10 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector

String f = ProjectSettings::get_singleton()->localize_path(p_file);

// Note: Only checks if base directory is case sensitive.
Ref<DirAccess> dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
bool fs_case_sensitive = dir->is_case_sensitive("res://");

if (!f.begins_with("res://")) {
return false;
}
Expand All @@ -1390,9 +1394,16 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector

int idx = -1;
for (int j = 0; j < fs->get_subdir_count(); j++) {
if (fs->get_subdir(j)->get_name() == path[i]) {
idx = j;
break;
if (fs_case_sensitive) {
if (fs->get_subdir(j)->get_name() == path[i]) {
idx = j;
break;
}
} else {
if (fs->get_subdir(j)->get_name().to_lower() == path[i].to_lower()) {
idx = j;
break;
}
}
}

Expand Down
Loading