- encapsulate folder/file names in quotes on Windows too

This commit is contained in:
Rachael Alexanderson 2022-08-14 10:38:15 -04:00
parent 259a8e0f74
commit dd07f6513f
1 changed files with 2 additions and 1 deletions

View File

@ -965,6 +965,7 @@ void I_OpenShellFolder(const char* folder)
FString proc = folder;
proc.ReplaceChars('/', '\\');
Printf("Opening folder: %s\n", proc.GetChars());
proc.Format("\"%s\"", proc.GetChars());
ShellExecuteW(NULL, L"open", L"explorer.exe", proc.WideString().c_str(), NULL, SW_SHOWNORMAL);
}
@ -973,7 +974,7 @@ void I_OpenShellFile(const char* file)
FString proc = file;
proc.ReplaceChars('/', '\\');
Printf("Opening folder to file: %s\n", proc.GetChars());
proc.Format("/select,%s", proc.GetChars());
proc.Format("/select,\"%s\"", proc.GetChars());
ShellExecuteW(NULL, L"open", L"explorer.exe", proc.WideString().c_str(), NULL, SW_SHOWNORMAL);
}