(Windows) Fixed an issue where file paths would get escaped with quotation marks even if they did not contain any spaces.

This commit is contained in:
Leon Styhre 2022-07-01 16:32:31 +02:00
parent 9cf4a65910
commit 0d23719fe7

View file

@ -390,7 +390,10 @@ namespace Utils
#if defined(_WIN64)
// Windows escapes stuff by just putting everything in quotes.
return '"' + getPreferredPath(escapedPath) + '"';
if (escapedPath.find(" ") != std::string::npos)
return '"' + getPreferredPath(escapedPath) + '"';
else
return getPreferredPath(escapedPath);
#else
// Insert a backslash before most characters that would mess up a bash path.
const char* invalidChars = "\\ '\"!$^&*(){}[]?;<>";