Current code attempts to copy a file to itself. File is not actually copied; instead, a file sharing error is received. This result is ugly and differs from native. Behavior now appears to be the same as native with changes in this MR .
-- v8: cmd/tests: Add tests for COPY to self. cmd: Don't attempt to copy a file to itself. cmd: Fix error parsing <NUL in the lexer. xcopy/tests: Add test for XCOPY to self. xcopy: Don't attempt to copy a file to itself.