- fixed: encapsulate folders for shell commands in quotes for Linux/Mac

This commit is contained in:
Rachael Alexanderson 2022-08-12 23:20:30 -04:00
parent e27e3453f9
commit 259a8e0f74
2 changed files with 4 additions and 4 deletions

View file

@ -173,14 +173,14 @@ unsigned int I_MakeRNGSeed()
void I_OpenShellFolder(const char* folder) void I_OpenShellFolder(const char* folder)
{ {
std::string x = (std::string)"open " + (std::string)folder; std::string x = (std::string)"open \"" + (std::string)folder + "\"";
Printf("Opening folder: %s\n", folder); Printf("Opening folder: %s\n", folder);
std::system(x.c_str()); std::system(x.c_str());
} }
void I_OpenShellFile(const char* file) void I_OpenShellFile(const char* file)
{ {
std::string x = (std::string)"open " + (std::string)file; std::string x = (std::string)"open \"" + (std::string)file + "\"";
x.erase(x.find_last_of('/'), std::string::npos); x.erase(x.find_last_of('/'), std::string::npos);
Printf("Opening folder to file: %s\n", file); Printf("Opening folder to file: %s\n", file);
std::system(x.c_str()); std::system(x.c_str());

View file

@ -434,14 +434,14 @@ unsigned int I_MakeRNGSeed()
void I_OpenShellFolder(const char* folder) void I_OpenShellFolder(const char* folder)
{ {
std::string x = (std::string)"xdg-open " + (std::string)folder; std::string x = (std::string)"xdg-open \"" + (std::string)folder + "\"";
Printf("Opening folder: %s\n", folder); Printf("Opening folder: %s\n", folder);
std::system(x.c_str()); std::system(x.c_str());
} }
void I_OpenShellFile(const char* file) void I_OpenShellFile(const char* file)
{ {
std::string x = (std::string)"xdg-open " + (std::string)file; std::string x = (std::string)"xdg-open \"" + (std::string)file + "\"";
x.erase(x.find_last_of('/'), std::string::npos); x.erase(x.find_last_of('/'), std::string::npos);
Printf("Opening folder to file: %s\n", file); Printf("Opening folder to file: %s\n", file);
std::system(x.c_str()); std::system(x.c_str());