-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
cp: fix crash on -T/--no-preserve-target #8864
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
Conversation
|
GNU testsuite comparison: |
|
Interesting how CI is having an embolism over EDIT: I was gaslighted by the internet yesterday, ima revert the commit. |
Fixed a couple of bugs: firstly, one where cp would error out when providing -T on some cases where the assumption of a prefix on the destination path was false; the second one was a logic error in which cp would not respect -T if the destination directory was provided with a terminator slash or (presumably, on Windows/DOS) a backslash.
|
@Alonely0 let chains have been introduced with Rust 1.88, see https://blog.rust-lang.org/2025/06/26/Rust-1.88.0/#let-chains |
|
Yeah, done. I've removed the unwrap call anyway; I don't feel comfortable with those. |
|
Thanks for your PR! |
This pull request fixes an edge case in which cp would crash when provided the -T flag, and also fixes a logic bug that arose in this edge case. Furthermore, a test case has been added to improve the test coverage of this flag. This PR fixes #8708.