cmd: Fix rmdir error during recursive delete.

This commit is contained in:
Jason Edmeades 2012-09-03 22:03:58 +01:00 committed by Alexandre Julliard
parent 514eb69584
commit 94f9e789c9
2 changed files with 5 additions and 1 deletions

View File

@ -1827,6 +1827,10 @@ void WCMD_remove_dir (WCHAR *command) {
lpDir.pFrom = thisArg;
lpDir.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI;
lpDir.wFunc = FO_DELETE;
/* SHFileOperationW needs file list with a double null termination */
thisArg[lstrlenW(thisArg) + 1] = 0x00;
if (SHFileOperationW(&lpDir)) WCMD_print_error ();
}
}

View File

@ -1163,7 +1163,7 @@ if not exist foo (
)
mkdir foo\bar\baz
echo foo > foo\bar\brol
rmdir /s /Q foo
rmdir /s /Q foo 2>&1
if not exist foo (
echo recursive rmdir succeeded
) else (