Skip to content
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: fix cp -f f loop when loop is a symlink loop #4820

Merged
merged 3 commits into from
May 4, 2023

Conversation

sylvestre
Copy link
Sponsor Contributor

Fix: tests/cp/thru-dangling.sh

@github-actions
Copy link

github-actions bot commented May 2, 2023

GNU testsuite comparison:

Congrats! The gnu test tests/cp/thru-dangling is no longer failing!

///
/// * An `io::Result<()>` that is `Ok(())` if no symlink loop is detected, or an error with `io::ErrorKind::InvalidInput`
/// if a loop is detected.
pub fn detect_symlink_loop(path: &Path) -> io::Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function feels a bit weird because in the success case (a symlink loop is detected) it returns an error. As you use this function anyway as if it returns a bool, I would just return a bool and rename it to something like is_symlink_loop.

@github-actions
Copy link

github-actions bot commented May 3, 2023

GNU testsuite comparison:

Congrats! The gnu test tests/cp/thru-dangling is no longer failing!
Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!

@cakebaker cakebaker merged commit 616a166 into uutils:main May 4, 2023
@sylvestre sylvestre deleted the thru-dangling-2 branch May 4, 2023 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants