From 259a8e0f7496ddd47866dcb5a7aff8075b09ea76 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Fri, 12 Aug 2022 23:20:30 -0400 Subject: [PATCH] - fixed: encapsulate folders for shell commands in quotes for Linux/Mac --- src/common/platform/posix/cocoa/i_system.mm | 4 ++-- src/common/platform/posix/sdl/i_system.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/platform/posix/cocoa/i_system.mm b/src/common/platform/posix/cocoa/i_system.mm index 02cad154a..f83536d53 100644 --- a/src/common/platform/posix/cocoa/i_system.mm +++ b/src/common/platform/posix/cocoa/i_system.mm @@ -173,14 +173,14 @@ unsigned int I_MakeRNGSeed() 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); std::system(x.c_str()); } 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); Printf("Opening folder to file: %s\n", file); std::system(x.c_str()); diff --git a/src/common/platform/posix/sdl/i_system.cpp b/src/common/platform/posix/sdl/i_system.cpp index 3dd43e98d..d96613494 100644 --- a/src/common/platform/posix/sdl/i_system.cpp +++ b/src/common/platform/posix/sdl/i_system.cpp @@ -434,14 +434,14 @@ unsigned int I_MakeRNGSeed() 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); std::system(x.c_str()); } 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); Printf("Opening folder to file: %s\n", file); std::system(x.c_str());