[CMD] COPY: Always remove the read-only attribute, for MS-DOS backwards-compatibility.

Tested and compared with MS CMD.EXE when copying files within the
same directory, across directories and across drives.
This is not done for the MOVE, REN and REPLACE commands however.

CORE-18090
This commit is contained in:
Hermès Bélusca-Maïto
2022-09-25 23:50:25 +02:00
parent 66d50537f4
commit 67ac583b5b

View File

@@ -258,7 +258,8 @@ copy(TCHAR source[MAX_PATH],
CloseHandle (hFileSrc);
TRACE ("setting mode\n");
SetFileAttributes (dest, dwAttrib);
/* For MS-DOS backwards-compatibility, always remove the read-only attribute */
SetFileAttributes (dest, dwAttribs & ~FILE_ATTRIBUTE_READONLY);
/* Now finish off the copy if needed with CopyFileEx */
if (lpdwFlags & COPY_RESTART)