Skip to content

Commit 5583ac5

Browse files
committed
Ignore trailing slashes in new project’s path when disabling Create Folder
In the “Create New Project” dialog, disabling the “Create Folder” slider with a trailing slash in the project path would cause it to incorrectly identify the last path component as the substring following the slash, in other words, an empty string. By first discarding any trailing slashes when disabling the slider, the project dialog will now identify and pop the last path component as usual even when a trailing slash is present.
1 parent b97110c commit 5583ac5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

editor/project_manager/project_dialog.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ void ProjectDialog::_create_dir_toggled(bool p_pressed) {
315315
target_path = target_path.path_join(last_custom_target_dir);
316316
}
317317
} else {
318+
// Strip any trailing slash.
319+
target_path = target_path.rstrip("/\\");
318320
// Save and remove target dir name.
319321
if (target_path.get_file() == auto_dir) {
320322
last_custom_target_dir = "";

0 commit comments

Comments
 (0)