xcopy: Fix copying empty directories.
Signed-off-by: Jason Edmeades <us@edmeades.me.uk> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8a84148e52
commit
c8fcedcf26
@ -103,7 +103,6 @@ static void test_parms_syntax(void)
|
|||||||
|
|
||||||
rc = runcmd("xcopy /D/S/E xcopytest xcopytest2\\");
|
rc = runcmd("xcopy /D/S/E xcopytest xcopytest2\\");
|
||||||
ok(rc == 0, "xcopy /D/S/E test failed rc=%u\n", rc);
|
ok(rc == 0, "xcopy /D/S/E test failed rc=%u\n", rc);
|
||||||
todo_wine
|
|
||||||
ok(GetFileAttributesA("xcopytest2") != INVALID_FILE_ATTRIBUTES,
|
ok(GetFileAttributesA("xcopytest2") != INVALID_FILE_ATTRIBUTES,
|
||||||
"xcopy failed to copy empty directory\n");
|
"xcopy failed to copy empty directory\n");
|
||||||
RemoveDirectoryA("xcopytest2");
|
RemoveDirectoryA("xcopytest2");
|
||||||
|
@ -590,6 +590,13 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
|
|||||||
|
|
||||||
/* Search 2 - do subdirs */
|
/* Search 2 - do subdirs */
|
||||||
if (flags & OPT_RECURSIVE) {
|
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);
|
lstrcpyW(inputpath, srcstem);
|
||||||
lstrcatW(inputpath, wchr_star);
|
lstrcatW(inputpath, wchr_star);
|
||||||
findres = TRUE;
|
findres = TRUE;
|
||||||
@ -613,12 +620,6 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
|
|||||||
lstrcpyW(outputpath, deststem);
|
lstrcpyW(outputpath, deststem);
|
||||||
if (*destspec == 0x00) {
|
if (*destspec == 0x00) {
|
||||||
lstrcatW(outputpath, finddata->cFileName);
|
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);
|
lstrcatW(outputpath, wchr_slash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user