Fix first argument of the target program so that paths with spaces aren't
reparsed by the c runtime as multiple arguments.

svn path=/trunk/; revision=56716
This commit is contained in:
Art Yerkes 2012-06-09 02:55:15 +00:00
parent 592fd1b680
commit 17c51a305d

View file

@ -396,7 +396,10 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest, PARSED_COMMAND *Cmd)
STARTUPINFO stui;
/* build command line for CreateProcess(): FullName + " " + rest */
_tcscpy(szFullCmdLine, szFullName);
BOOL quoted = !!_tcschr(First, ' ');
_tcscpy(szFullCmdLine, quoted ? _T("\"") : _T(""));
_tcsncat(szFullCmdLine, First, CMDLINE_LENGTH - _tcslen(szFullCmdLine));
_tcsncat(szFullCmdLine, quoted ? _T("\"") : _T(""), CMDLINE_LENGTH - _tcslen(szFullCmdLine));
if (*rest)
{