On Fri Oct 17 10:35:03 2025 +0000, eric pouech wrote:
fixing cmd.exe can sometimes be tedious your intent is to fix COPY command when asked to have the same file as source and destination the goal should be to replace the broken parts with correct code, not (half) broken (eg. the CI is reports failures with this patch) I'd suggest you use these changes for the tests (derived from your work) to be used in both .cmd and .bat context ``` call :setError 666 & (copy /b fileA fileA /Y >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) call :setError 666 & (copy /b fileA+fileB fileA >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) type fileA echo a > fileA call :setError 666 & (copy /b fileA+fileB /Y fileB >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) type fileB ``` but basically, for multiple source files, if one of the source file is the dest file: - if it's not the first one, cmd.exe will ask for permission to overwrite it, but will do nothing - if it's the first one, it proceeeds by appending the next files - success is always returned - I believe some of your tests are failing because of the missing /Y option, and fails with the overwrite question some notes: - COPY /B will prevent appending a ctrl-z which will be a pain with the TYPE output - I didn't cover the behaviors without /Y (which is another dimension); but this should covered at some point in time if you wish you can concentrate first only on the single source file case and leave the multiple one for later on (tests can be added for the single & multiple cases, but the todo_wine should mark the missing bits) also XCOPY will need tests Note that the tests are not failing, at least not for me. The problem is that the output of the tests (the success/failure for COPY tests) differ from those of native Windows 10. That's what I've been trying to track down, but I've spent a lot of time on this and am becoming discouraged.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9112#note_118966