Sync with trunk r63174.

CORE-8176 #resolve #comment Trunk commit r63174 should fix this issue. I merged from trunk to bring it into Shell-experiments.

svn path=/branches/shell-experiments/; revision=63175
This commit is contained in:
David Quintana 2014-05-06 15:51:24 +00:00
commit 057a69972f
323 changed files with 17885 additions and 12574 deletions

View file

@ -58,7 +58,7 @@ PrintAlias (VOID)
DWORD len;
len = GetConsoleAliasesLength(_T("cmd.exe"));
if (len <= 0)
if (len == 0)
return;
/* allocate memory for an extra \0 char to make parsing easier */

View file

@ -397,13 +397,13 @@ Execute(LPTSTR Full, LPTSTR First, LPTSTR Rest, PARSED_COMMAND *Cmd)
/* build command line for CreateProcess(): FullName + " " + rest */
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));
_tcsncat(szFullCmdLine, First, CMDLINE_LENGTH - _tcslen(szFullCmdLine) - 1);
_tcsncat(szFullCmdLine, quoted ? _T("\"") : _T(""), CMDLINE_LENGTH - _tcslen(szFullCmdLine) - 1);
if (*rest)
{
_tcsncat(szFullCmdLine, _T(" "), CMDLINE_LENGTH - _tcslen(szFullCmdLine));
_tcsncat(szFullCmdLine, rest, CMDLINE_LENGTH - _tcslen(szFullCmdLine));
_tcsncat(szFullCmdLine, _T(" "), CMDLINE_LENGTH - _tcslen(szFullCmdLine) - 1);
_tcsncat(szFullCmdLine, rest, CMDLINE_LENGTH - _tcslen(szFullCmdLine) - 1);
}
TRACE ("[EXEC: %s]\n", debugstr_aw(szFullCmdLine));