https://git.reactos.org/?p=reactos.git;a=commitdiff;h=67ac583b5bfb5c72fd1cd…
commit 67ac583b5bfb5c72fd1cd88ee7c211979d6e190b
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Sep 25 23:50:25 2022 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Sep 25 23:55:27 2022 +0200
[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
---
base/shell/cmd/copy.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/base/shell/cmd/copy.c b/base/shell/cmd/copy.c
index 40bf43eda0d..73901d7cd91 100644
--- a/base/shell/cmd/copy.c
+++ b/base/shell/cmd/copy.c
@@ -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)