-
-
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: incorrectly copies directory when path ends in dot #3897
Comments
I'm working on this! Edit: I'm not working on this anymore |
I had a quick look into this. The issue is that rust normalizes out of existence most occurrences of '.' in paths whenever API methods are called (i.e. lazily) which interacts incorrectly with the logic that's in place. In particular, let root_parent = if target.exists() {
root_path.parent()
} else {
Some(root_path.as_path())
}; produces the wrong answer in the case of the code in
leads to I don't see an easy fix here; it's probably going to come down to a custom implementation running over the |
Closing this ticket as it seems to be fixed and the directory is not copied when running the example. |
cp -R
incorrectly copies a directory when the path ends in a dot.GNU cp v8.30:
uutils cp:
The corresponding GNU test case is
tests/cp/src-base-dot.sh
. This test is incorrectly marked as passing on the main branch because the GNU test case doesn't actually verify that the directoryx/
is not copied toy/
.Originally mentioned by @jfinkels in #3894 (comment)
The text was updated successfully, but these errors were encountered: