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

In cp, are FLAG_r and FLAG_R always equal to each other? #296

Open
chrishappy opened this issue Oct 4, 2021 · 0 comments
Open

In cp, are FLAG_r and FLAG_R always equal to each other? #296

chrishappy opened this issue Oct 4, 2021 · 0 comments

Comments

@chrishappy
Copy link

For cp, the help text reads:

    -R       Recurse into subdirectories (DEST must be a directory)
    -r	       Synonym for -R

Then, on line 193, we see both flags being used:

Line 193: if (!(flags & (FLAG_a|FLAG_r|FLAG_R))) {

Then on the following three lines, only one r flag is being used.

Line 147: if (S_ISLNK(try->st.st_mode) && (flags & FLAG_d)) flags |= FLAG_r;
Line 245: && (try->parent || (flags & (FLAG_a|FLAG_P|FLAG_r))))
Line 467: toys.optflags |= FLAG_d|FLAG_p|FLAG_R;

Is the use on L193 redundant? Or is there a bug on the latter three lines of code?

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

No branches or pull requests

1 participant