mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
- Don't double-quote an already double-quoted argument
- Properly increment the fmt pointer svn path=/trunk/; revision=11375
This commit is contained in:
parent
69b98bb582
commit
b3e27217fd
1 changed files with 9 additions and 3 deletions
|
@ -142,8 +142,10 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
|
|||
else
|
||||
cmd = lpFile;
|
||||
|
||||
/* Add double quotation marks unless we already have them (e.g.: "file://%1" %* for exefile) */
|
||||
if (res == out || *(fmt + 1) != '"')
|
||||
/* Add double quotation marks unless we already have them
|
||||
(e.g.: "file://%1" %* for exefile) or unless the arg is already
|
||||
enclosed in double quotation marks */
|
||||
if ((res == out || *(fmt + 1) != '"') && *cmd != '"')
|
||||
{
|
||||
*res++ = '"';
|
||||
strcpyW(res, cmd);
|
||||
|
@ -207,10 +209,14 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
|
|||
strcpyW( res, tmpEnvBuff );
|
||||
res += strlenW(res);
|
||||
}
|
||||
fmt++;
|
||||
done = TRUE;
|
||||
break;
|
||||
}
|
||||
/* Don't skip past terminator (catch a single '%' at the end) */
|
||||
if (*fmt != '\0')
|
||||
{
|
||||
fmt++;
|
||||
}
|
||||
}
|
||||
else
|
||||
*res++ = *fmt++;
|
||||
|
|
Loading…
Reference in a new issue