From e495a7afc2677c7908704d2ae2aa713a989d9daa Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 31 May 2012 21:17:11 -0500 Subject: cp doesn't really need the optstring + logic. Still needs to be updated for new dirtree, though. --- toys/cp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'toys') diff --git a/toys/cp.c b/toys/cp.c index a53d5fe0..bc922b3d 100644 --- a/toys/cp.c +++ b/toys/cp.c @@ -7,7 +7,7 @@ * See http://www.opengroup.org/onlinepubs/009695399/utilities/cp.html * * "R+ra+d+p+r" -USE_CP(NEWTOY(cp, "<2vslrR+rdpa+d+p+rHLPif", TOYFLAG_BIN)) +USE_CP(NEWTOY(cp, "<2vslrRdpaHLPif", TOYFLAG_BIN)) config CP bool "cp (broken by dirtree changes)" @@ -113,7 +113,7 @@ void cp_file(char *src, char *dst, struct stat *srcst) // Inability to set these isn't fatal, some require root access. // Can't do fchmod() etc here because -p works on mkdir, too. - if (toys.optflags & FLAG_p) { + if (toys.optflags & (FLAG_p|FLAG_a)) { int mask = umask(0); struct utimbuf ut; @@ -188,7 +188,7 @@ void cp_main(void) // Skip nonexistent sources. - TT.keep_symlinks = toys.optflags & FLAG_d; + TT.keep_symlinks = toys.optflags & (FLAG_d|FLAG_a); if (TT.keep_symlinks ? lstat(src, &st) : stat(src, &st)) { perror_msg("'%s'", src); @@ -205,7 +205,7 @@ void cp_main(void) dst = xmsprintf("%s/%s", TT.destname, dst); } else dst = TT.destname; if (S_ISDIR(st.st_mode)) { - if (toys.optflags & FLAG_r) { + if (toys.optflags & (FLAG_r|FLAG_R|FLAG_a)) { cp_file(src, dst, &st); TT.keep_symlinks++; -- cgit v1.2.3