aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2004-01-25 05:50:28 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2004-01-25 05:50:28 +0000
commit4766a2d56c7e293eef248d46d02cb369148e7258 (patch)
tree8389662dd35976b52a626301bfc87df78ffecf88 /coreutils
parent303e989a119e99d79588b682c287f1bb491288a8 (diff)
downloadbusybox-4766a2d56c7e293eef248d46d02cb369148e7258.tar.gz
Add the -r option as a synonym of -R
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c
index c5dd31ec3..6a82f6bff 100644
--- a/coreutils/cp.c
+++ b/coreutils/cp.c
@@ -41,7 +41,8 @@
#include "busybox.h"
#include "libcoreutils/coreutils.h"
-static const char cp_opts[] = "pdRfia"; /* WARNING!! ORDER IS IMPORTANT!! */
+/* WARNING!! ORDER IS IMPORTANT!! */
+static const char cp_opts[] = "pdRfiar";
extern int cp_main(int argc, char **argv)
{
@@ -66,6 +67,12 @@ extern int cp_main(int argc, char **argv)
if (flags & 32) {
flags |= (FILEUTILS_PRESERVE_STATUS | FILEUTILS_RECUR | FILEUTILS_DEREFERENCE);
}
+ if (flags & 64) {
+ /* Make -r a synonym for -R,
+ * -r was marked as obsolete in SUSv3, but is included for compatability
+ */
+ flags |= FILEUTILS_RECUR;
+ }
flags ^= FILEUTILS_DEREFERENCE; /* The sense of this flag was reversed. */