Browse Source

Remove trailing slash from recent dir if needed

(cherry picked from commit 709e71ae9c050a5b28b662d885d24acf31853a80)
Paweł Fertyk 4 years ago
parent
commit
f36a3c67e3
1 changed files with 3 additions and 0 deletions
  1. 3 0
      editor/editor_file_dialog.cpp

+ 3 - 0
editor/editor_file_dialog.cpp

@@ -284,6 +284,9 @@ void EditorFileDialog::_post_popup() {
 			if (res && name == "res://") {
 			if (res && name == "res://") {
 				name = "/";
 				name = "/";
 			} else {
 			} else {
+				if (name.ends_with("/")) {
+					name = name.substr(0, name.length() - 1);
+				}
 				name = name.get_file() + "/";
 				name = name.get_file() + "/";
 			}
 			}
 			bool exists = dir_access->dir_exists(recentd[i]);
 			bool exists = dir_access->dir_exists(recentd[i]);