From 0d23719fe77eead46e4b14dc43a57cf75de1b6ad Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 1 Jul 2022 16:32:31 +0200 Subject: [PATCH] (Windows) Fixed an issue where file paths would get escaped with quotation marks even if they did not contain any spaces. --- es-core/src/utils/FileSystemUtil.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/es-core/src/utils/FileSystemUtil.cpp b/es-core/src/utils/FileSystemUtil.cpp index 6904c9404..4ac86cd9b 100644 --- a/es-core/src/utils/FileSystemUtil.cpp +++ b/es-core/src/utils/FileSystemUtil.cpp @@ -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 = "\\ '\"!$^&*(){}[]?;<>";