Commit 81fe7a21 authored by Myah Caron's avatar Myah Caron Committed by Alexandre Julliard

cmd.exe: Fix /Y flag for move builtin.

parent fc1bb9af
......@@ -3003,6 +3003,7 @@ void WCMD_move (void)
WCHAR src[MAX_PATH];
DWORD attribs;
BOOL ok = TRUE;
DWORD flags = 0;
WINE_TRACE("Processing file '%s'\n", wine_dbgstr_w(fd.cFileName));
......@@ -3051,20 +3052,14 @@ void WCMD_move (void)
question = WCMD_format_string(WCMD_LoadMessage(WCMD_OVERWRITE), dest);
ok = WCMD_ask_confirm(question, FALSE, NULL);
LocalFree(question);
/* So delete the destination prior to the move */
if (ok) {
if (!DeleteFileW(dest)) {
WCMD_print_error ();
errorlevel = 1;
ok = FALSE;
}
}
}
if (ok)
flags |= MOVEFILE_REPLACE_EXISTING;
}
if (ok) {
status = MoveFileW(src, dest);
status = MoveFileExW(src, dest, flags);
} else {
status = TRUE;
}
......
......@@ -1343,8 +1343,8 @@ original file still present
------------ Testing move ------------
--- file move
file move succeeded
@todo_wine@file move with overwrite succeeded@or_broken@file overwrite impossible!
@todo_wine@bar@or_broken@baz
file move with overwrite succeeded@or_broken@file overwrite impossible!
bar@or_broken@baz
read-only files are moveable
file moved in subdirectory
moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op!
......
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