Skip to content

Commit

Permalink
Fix EditorFileSystemDirectory::get_file_deps() may return wrong res…
Browse files Browse the repository at this point in the history
…ults

Limit the maxsplit to `8` to get complete `deps`.

`deps` caches the return value of `ResourceLoader::get_dependencies()`,
which is also separated by "::".
"::" is quite popular as a splitter.
  • Loading branch information
Rindbee committed Oct 10, 2023
1 parent 6b727eb commit 203f3e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/editor_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ void EditorFileSystem::_scan_filesystem() {
cpath = name;

} else {
Vector<String> split = l.split("::");
// The last section (deps) may contain the same splitter, so limit the maxsplit to 8 to get the complete deps.
Vector<String> split = l.split("::", true, 8);
ERR_CONTINUE(split.size() < 9);
String name = split[0];
String file;
Expand Down

0 comments on commit 203f3e7

Please sign in to comment.