Module: wine Branch: master Commit: 9be151c2e9d9301c128c387cdb2d47a464012864 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9be151c2e9d9301c128c387cdb...
Author: Misha Koshelev mk144210@bcm.edu Date: Sat Jun 16 16:00:08 2007 -0500
shell32: Conform to native in SHELL_ArgifyW for unquoted %1 in registry keys.
---
dlls/shell32/shlexec.c | 29 ++++------------------------- dlls/shell32/tests/shlexec.c | 2 +- 2 files changed, 5 insertions(+), 26 deletions(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index edb65ea..45f7621 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 7fc34fb..66b9406 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},