-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cp: treat an empty file name as a non-existing file #6683
Conversation
fa3a37b
to
74c0963
Compare
7d27f1f
to
55e0521
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Straight-forward implementation, tests, lovely.
Can you make the tests a bit more specific, just in case cp
encounters an unrelated issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The unhelpful error message on windows is a pity, but out of scope for this PR.
Let's see if known issue #6534 remains the only CI failure.
EDIT: Oops, I celebrated too early.
thread 'test_cp::test_cp_multiple_files_with_empty_file_name' panicked at tests\by-util\test_cp.rs:182:10:
'cp: The system cannot find the path specified. (os error 3)
' does not contain 'The system cannot find the file specified'
33227c6
to
d8348ea
Compare
The message on Windows is different for the empty file name and other non-existent file names. I've entered a new version. |
GNU testsuite comparison:
|
@BenWiederhake The only failing test is the Windows test coverage which has since be disabled in the CI. |
d8348ea
to
d2846bc
Compare
Thanks! |
The
PathBuf
value parser fromclap
cannot be used directly as it does not (rightly) accept empty file names.Fix #6177