From 387e9bea8bb3ab8dca6eca1e47bbf1bd58746b03 Mon Sep 17 00:00:00 2001 From: koldo Date: Thu, 14 Apr 2016 06:31:28 +0000 Subject: [PATCH] *Functions4U: Fix bug detected by biobytes git-svn-id: svn://ultimatepp.org/upp/trunk@9695 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- bazaar/Functions4U/LocalProcess2.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/bazaar/Functions4U/LocalProcess2.cpp b/bazaar/Functions4U/LocalProcess2.cpp index b26ceaa69..e8299ca13 100644 --- a/bazaar/Functions4U/LocalProcess2.cpp +++ b/bazaar/Functions4U/LocalProcess2.cpp @@ -132,13 +132,10 @@ bool LocalProcess2::DoStart(const char *_command, const Vector *arg, boo if(*s == '\0') { command.Cat('\\', 2 * num_backslashes); break; - } - else - if(*s == '\"') { + } else if(*s == '\"') { command.Cat('\\', 2 * num_backslashes + 1); command << '\"'; - } - else { + } else { command.Cat('\\', num_backslashes); command.Cat(*s); } @@ -148,14 +145,14 @@ bool LocalProcess2::DoStart(const char *_command, const Vector *arg, boo } } } - WStringBuffer wscmd(ToSystemCharsetW(command)); + WString wscmd(ToSystemCharsetW(command)); WString wsdir(ToSystemCharsetW(dir)); const wchar *wdir; if (dir == 0) wdir = 0; else wdir = wsdir; - bool h = CreateProcessW(NULL, wscmd, &sa, &sa, TRUE, NORMAL_PRIORITY_CLASS, (void *)envptr, wdir, &si, &pi); + bool h = CreateProcessW(NULL, WStringBuffer(wscmd), &sa, &sa, TRUE, NORMAL_PRIORITY_CLASS, (void *)envptr, wdir, &si, &pi); LLOG("CreateProcess " << (h ? "succeeded" : "failed")); CloseHandle(hErrorWrite); CloseHandle(hInputRead);