shell32: Conform to native in SHELL_ArgifyW for unquoted %1 in registry keys.

This commit is contained in:
Misha Koshelev 2007-06-16 16:00:08 -05:00 committed by Alexandre Julliard
parent e0940226cd
commit 9be151c2e9
2 changed files with 5 additions and 26 deletions

View File

@ -156,32 +156,11 @@ 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) or unless the arg is already
enclosed in double quotation marks */
if ((res == out || *(fmt + 1) != '"') && *cmd != '"')
used += strlenW(cmd);
if (used < len)
{
used++;
if (used < len)
*res++ = '"';
used += strlenW(cmd);
if (used < len)
{
strcpyW(res, cmd);
res += strlenW(cmd);
}
used++;
if (used < len)
*res++ = '"';
}
else
{
used += strlenW(cmd);
if (used < len)
{
strcpyW(res, cmd);
res += strlenW(cmd);
}
strcpyW(res, cmd);
res += strlenW(cmd);
}
}
found_p1 = TRUE;

View File

@ -1064,7 +1064,7 @@ static dde_tests_t dde_tests[] =
/* Test unquoted %1 in command and ddeexec
* (test filename has space) */
{"%1", "[open(%1)]", "shlexec", "dde", NULL, 2, "[open(%s)]", 0xa, 33},
{"%1", "[open(%1)]", "shlexec", "dde", NULL, 2, "[open(%s)]", 0x0, 33},
/* Test ifexec precedence over ddeexec */
{"", "[open(\"%1\")]", "shlexec", "dde", "[ifexec(\"%1\")]", FALSE, "[ifexec(\"%s\")]", 0x0, 33},