1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #104022 from precup/create_directory_fix

Defend against directories without trailing slashes
This commit is contained in:
Rémi Verschelde
2025-03-19 12:27:07 +01:00
2 changed files with 8 additions and 2 deletions

View File

@@ -3445,7 +3445,7 @@ Error EditorFileSystem::make_dir_recursive(const String &p_path, const String &p
ERR_FAIL_NULL_V(parent, ERR_FILE_NOT_FOUND);
folders_to_sort.insert(parent->get_instance_id());
const PackedStringArray folders = p_path.trim_prefix(path).trim_suffix("/").split("/");
const PackedStringArray folders = p_path.trim_prefix(path).split("/", false);
for (const String &folder : folders) {
const int current = parent->find_dir_index(folder);
if (current > -1) {