[PATCH 1/3] shell32: Don't quote args substituted through wildcard in SHELL_ArgifyW().
Paul Gofman
wine at gitlab.winehq.org
Thu Jun 30 14:38:06 CDT 2022
From: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
dlls/shell32/shlexec.c | 4 ----
dlls/shell32/tests/shlexec.c | 13 +++++++------
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 8c7e3cf0808..fbf39e99fc6 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -110,8 +110,6 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
if (*fmt == '*')
{
used++;
- if (used < len)
- *res++ = '"';
while(*args)
{
used++;
@@ -121,8 +119,6 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
args++;
}
used++;
- if (used < len)
- *res++ = '"';
}
else
{
diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index 50c2e84578b..50de1eeb750 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -1418,11 +1418,11 @@ typedef struct
static const argify_tests_t argify_tests[] =
{
- /* Start with three simple parameters. Notice that one can reorder and
- * duplicate the parameters. Also notice how %* take the raw input
- * parameters string, including the trailing spaces, no matter what
- * arguments have already been used.
- */
+ {"ParamsS", "p2 p3 \"p4 ", FALSE, " p2 p3 \"p4 "},
+
+ /* Notice that one can reorder and duplicate the parameters.
+ * Also notice how %* take the raw input parameters string, including
+ * the trailing spaces, no matter what arguments have already been used. */
{"Params232S", "p2 p3 p4 ", TRUE,
" p2 p3 \"p2\" \"p2 p3 p4 \""},
@@ -1567,6 +1567,7 @@ static void test_argify(void)
return;
}
+ create_test_verb("shlexec.shlexec", "ParamsS", 0, "ParamsS %*");
create_test_verb("shlexec.shlexec", "Params232S", 0, "Params232S %2 %3 \"%2\" \"%*\"");
create_test_verb("shlexec.shlexec", "Params23456", 0, "Params23456 \"%2\" \"%3\" \"%4\" \"%5\" \"%6\"");
create_test_verb("shlexec.shlexec", "Params23456789", 0, "Params23456789 \"%2\" \"%3\" \"%4\" \"%5\" \"%6\" \"%7\" \"%8\" \"%9\"");
@@ -1594,7 +1595,7 @@ static void test_argify(void)
if (!cmd) cmd = "(null)";
todo_wine_if(test->todo)
okShell(!strcmp(cmd, test->cmd) || broken(!strcmp(cmd, bad)),
- "expected '%s', got '%s'\n", cmd, test->cmd);
+ "expected '%s', got '%s'\n", test->cmd, cmd);
test++;
}
}
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/353
More information about the wine-devel
mailing list