Change way of quoting arguments so explorer /select can be called

(should find a better way to do this)
This commit is contained in:
Santiago 2023-08-18 21:46:00 +02:00
parent 11c5d00f97
commit f05dc7e362

View File

@ -178,9 +178,9 @@ namespace util
// need to do so --- hopefully avoid problems if programs won't // need to do so --- hopefully avoid problems if programs won't
// parse quotes properly // parse quotes properly
// //
bool containsCharThatNeedsQuoting = argument.find_first_of(L" \t\n\v\"") != argument.npos;
if (force == false && argument.empty() == false && bool containsCharThatNeedsNoQuoting = argument.find_first_of(L"/") != argument.npos;
argument.find_first_of(L" \t\n\v\"") == argument.npos) { if (!force && !argument.empty() && (!containsCharThatNeedsQuoting || containsCharThatNeedsNoQuoting)) {
command_line.append(argument); command_line.append(argument);
} }
else { else {
@ -1514,7 +1514,7 @@ inline void Popen::execute_process() noexcept(false)
for (auto arg : this->vargs_) { for (auto arg : this->vargs_) {
argument = converter.from_bytes(arg); argument = converter.from_bytes(arg);
util::quote_argument(argument, command_line, true); util::quote_argument(argument, command_line, false);
command_line += L" "; command_line += L" ";
} }