From d3a0ac4c3455385273c80eff6aff4f1cb30fff8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 20 Jul 2017 20:26:27 -0700 Subject: [PATCH] Quote executable name in case there are spaces. --- src/process.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/process.cpp b/src/process.cpp index 4b28b19..358907f 100644 --- a/src/process.cpp +++ b/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");