From 203f3e700bfd290b2c7c7156e8a66fb51633cba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E9=9D=92=E5=B1=B1?= Date: Tue, 10 Oct 2023 08:50:20 +0800 Subject: [PATCH] Fix `EditorFileSystemDirectory::get_file_deps()` may return wrong results 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. --- editor/editor_file_system.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index db541796331a..b17a0a2223fd 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -261,7 +261,8 @@ void EditorFileSystem::_scan_filesystem() { cpath = name; } else { - Vector split = l.split("::"); + // The last section (deps) may contain the same splitter, so limit the maxsplit to 8 to get the complete deps. + Vector split = l.split("::", true, 8); ERR_CONTINUE(split.size() < 9); String name = split[0]; String file;