aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/cp.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2021-11-26 21:06:15 -0600
committerRob Landley <rob@landley.net>2021-11-26 21:06:15 -0600
commit3471149f1eaff891f2bb3814b3fec0dae61a0005 (patch)
tree6db6b2e2a0b410eef9413563776637f85d960455 /toys/posix/cp.c
parentddf01ab133900decbb9ad46df205f7647d43936e (diff)
downloadtoybox-3471149f1eaff891f2bb3814b3fec0dae61a0005.tar.gz
Always test -r and have plumbing set -r for -R
Diffstat (limited to 'toys/posix/cp.c')
-rw-r--r--toys/posix/cp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index ed62f04d..7e7aa100 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -15,7 +15,7 @@
// options shared between mv/cp must be in same order (right to left)
// for FLAG macros to work out right in shared infrastructure.
-USE_CP(NEWTOY(cp, "<1(preserve):;D(parents)RHLPprudaslvnF(remove-destination)fit:T[-HLPd][-niu]", TOYFLAG_BIN))
+USE_CP(NEWTOY(cp, "<1(preserve):;D(parents)RHLPprudaslvnF(remove-destination)fit:T[-HLPd][-niu][+Rr]", TOYFLAG_BIN))
USE_MV(NEWTOY(mv, "<1vnF(remove-destination)fit:T[-ni]", TOYFLAG_BIN))
USE_INSTALL(NEWTOY(install, "<1cdDpsvt:m:o:g:", TOYFLAG_USR|TOYFLAG_BIN))
@@ -190,7 +190,7 @@ static int cp_node(struct dirtree *try)
if (S_ISDIR(try->st.st_mode)) {
struct stat st2;
- if (!(flags & (FLAG_a|FLAG_r|FLAG_R))) {
+ if (!(flags & (FLAG_a|FLAG_r))) {
err = "Skipped dir '%s'";
catch = try->name;
break;
@@ -464,7 +464,7 @@ void cp_main(void)
void mv_main(void)
{
- toys.optflags |= FLAG_d|FLAG_p|FLAG_R;
+ toys.optflags |= FLAG_d|FLAG_p|FLAG_r;
cp_main();
}