From f05dc7e362265bba0d1d3053ca48bc58cc31a06b Mon Sep 17 00:00:00 2001 From: Santiago Date: Fri, 18 Aug 2023 21:46:00 +0200 Subject: [PATCH] Change way of quoting arguments so explorer /select can be called (should find a better way to do this) --- subprocess.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprocess.hpp b/subprocess.hpp index 1e9b86d..6f91090 100755 --- a/subprocess.hpp +++ b/subprocess.hpp @@ -178,9 +178,9 @@ namespace util // need to do so --- hopefully avoid problems if programs won't // parse quotes properly // - - if (force == false && argument.empty() == false && - argument.find_first_of(L" \t\n\v\"") == argument.npos) { + bool containsCharThatNeedsQuoting = argument.find_first_of(L" \t\n\v\"") != argument.npos; + bool containsCharThatNeedsNoQuoting = argument.find_first_of(L"/") != argument.npos; + if (!force && !argument.empty() && (!containsCharThatNeedsQuoting || containsCharThatNeedsNoQuoting)) { command_line.append(argument); } else { @@ -1514,7 +1514,7 @@ inline void Popen::execute_process() noexcept(false) for (auto arg : this->vargs_) { argument = converter.from_bytes(arg); - util::quote_argument(argument, command_line, true); + util::quote_argument(argument, command_line, false); command_line += L" "; }