diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index edb65eac3c6..45f7621d808 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -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; diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 7fc34fbafc9..66b94065269 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -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},