Commit c8fcedcf authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

xcopy: Fix copying empty directories.

parent 8a84148e
......@@ -103,7 +103,6 @@ static void test_parms_syntax(void)
rc = runcmd("xcopy /D/S/E xcopytest xcopytest2\\");
ok(rc == 0, "xcopy /D/S/E test failed rc=%u\n", rc);
todo_wine
ok(GetFileAttributesA("xcopytest2") != INVALID_FILE_ATTRIBUTES,
"xcopy failed to copy empty directory\n");
RemoveDirectoryA("xcopytest2");
......
......@@ -590,6 +590,13 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
/* Search 2 - do subdirs */
if (flags & OPT_RECURSIVE) {
/* If /E is supplied, create the directory now */
if ((flags & OPT_EMPTYDIR) &&
!(flags & OPT_SIMULATE)) {
XCOPY_CreateDirectory(deststem);
}
lstrcpyW(inputpath, srcstem);
lstrcatW(inputpath, wchr_star);
findres = TRUE;
......@@ -613,12 +620,6 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
lstrcpyW(outputpath, deststem);
if (*destspec == 0x00) {
lstrcatW(outputpath, finddata->cFileName);
/* If /E is supplied, create the directory now */
if ((flags & OPT_EMPTYDIR) &&
!(flags & OPT_SIMULATE))
XCOPY_CreateDirectory(outputpath);
lstrcatW(outputpath, wchr_slash);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment