Pārlūkot izejas kodu

Merge pull request #78963 from bgie/comma_in_filename

Windows: Always double-quote path when launching explorer.exe to browse
Rémi Verschelde 2 gadi atpakaļ
vecāks
revīzija
6584cd88d9
1 mainītis faili ar 2 papildinājumiem un 7 dzēšanām
  1. 2 7
      platform/windows/os_windows.cpp

+ 2 - 7
platform/windows/os_windows.cpp

@@ -1356,18 +1356,13 @@ Error OS_Windows::shell_open(String p_uri) {
 }
 
 Error OS_Windows::shell_show_in_file_manager(String p_path, bool p_open_folder) {
-	p_path = p_path.trim_suffix("file://");
-
 	bool open_folder = false;
 	if (DirAccess::dir_exists_absolute(p_path) && p_open_folder) {
 		open_folder = true;
 	}
 
-	if (p_path.begins_with("\"")) {
-		p_path = String("\"") + p_path;
-	}
-	if (p_path.ends_with("\"")) {
-		p_path = p_path + String("\"");
+	if (!p_path.is_quoted()) {
+		p_path = p_path.quote();
 	}
 	p_path = p_path.replace("/", "\\");