From: Hans Leidekker hans@codeweavers.com
--- programs/xcopy/tests/xcopy.c | 7 +++++++ programs/xcopy/xcopy.c | 13 ++++++------- 2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/programs/xcopy/tests/xcopy.c b/programs/xcopy/tests/xcopy.c index 61fbad9ccaf..e038f69ad02 100644 --- a/programs/xcopy/tests/xcopy.c +++ b/programs/xcopy/tests/xcopy.c @@ -117,6 +117,13 @@ static void test_parms_syntax(void) ok(GetFileAttributesA("xcopytest2") != INVALID_FILE_ATTRIBUTES, "xcopy failed to copy empty directory\n"); RemoveDirectoryA("xcopytest2"); + + CreateDirectoryA("xcopy test2", NULL); + rc = runcmd("xcopy /S/R/Y/I "xcopytest" "xcopy test2""); + ok(rc == 0, "xcopy /S/R/Y/I test failed rc=%lu\n", rc); + ok(GetFileAttributesA("xcopy test2") != INVALID_FILE_ATTRIBUTES, + "xcopy failed to copy empty directory\n"); + RemoveDirectoryA("xcopy test2"); }
static void test_keep_attributes(void) diff --git a/programs/xcopy/xcopy.c b/programs/xcopy/xcopy.c index 46a2727dd49..ce3e40d7d5e 100644 --- a/programs/xcopy/xcopy.c +++ b/programs/xcopy/xcopy.c @@ -665,17 +665,16 @@ static inline BOOL is_digit(WCHAR c) static int get_arg(const WCHAR **cmdline, WCHAR **arg) { const WCHAR *ptr = *cmdline; - int len; + int len, in_quotes = 0;
if (*ptr == '/') ptr++; - while (*ptr && !is_whitespace(*ptr) && *ptr != '/') { - if (*ptr == '"') { - while (*ptr && *ptr != '"') ptr++; - /* Odd number of double quotes is illegal for XCOPY */ - if (!*ptr) return RC_INITERROR; - } + while (*ptr) { + if (*ptr == '"') in_quotes = !in_quotes; + if ((*ptr == '/' || is_whitespace(*ptr)) && !in_quotes) break; ptr++; } + /* Odd number of double quotes is illegal for XCOPY */ + if (in_quotes) return RC_INITERROR;
len = ptr - *cmdline; *arg = malloc((len + 1) * sizeof(WCHAR));
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=150970
Your paranoid android.
=== debian11b (64 bit WoW report) ===
mf: mf.c:6785: Test failed: Unexpected hr 0.
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 0000000001B400F2, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032 win.c:4070: Test failed: Expected active window 0000000000EE017C, got 0000000000000000. win.c:4071: Test failed: Expected focus window 0000000000EE017C, got 0000000000000000.
This merge request was approved by Piotr Caban.