Explorar o código

Quote executable name in case there are spaces.

Branimir Karadžić %!s(int64=8) %!d(string=hai) anos
pai
achega
d3a0ac4c34
Modificáronse 1 ficheiros con 6 adicións e 6 borrados
  1. 6 6
      src/process.cpp

+ 6 - 6
src/process.cpp

@@ -46,9 +46,9 @@ namespace bx
 			return false;
 		}
 
-		char tmp[kMaxFilePath*2];
-		strCopy(tmp, BX_COUNTOF(tmp), _filePath.get() );
-		strCat(tmp, BX_COUNTOF(tmp), " ");
+		char tmp[kMaxFilePath*2] = "\"";
+		strCat(tmp, BX_COUNTOF(tmp), _filePath.get() );
+		strCat(tmp, BX_COUNTOF(tmp), "\" ");
 		strCat(tmp, BX_COUNTOF(tmp), _args);
 
 		m_file = popen(tmp, "r");
@@ -117,9 +117,9 @@ namespace bx
 			return false;
 		}
 
-		char tmp[kMaxFilePath*2];
-		strCopy(tmp, BX_COUNTOF(tmp), _filePath.get() );
-		strCat(tmp, BX_COUNTOF(tmp), " ");
+		char tmp[kMaxFilePath*2] = "\"";
+		strCat(tmp, BX_COUNTOF(tmp), _filePath.get() );
+		strCat(tmp, BX_COUNTOF(tmp), "\" ");
 		strCat(tmp, BX_COUNTOF(tmp), _args);
 
 		m_file = popen(tmp, "w");