diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-01-07 00:56:47 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-01-07 00:56:47 +0000 |
commit | 6077d90c26b1e102a6bb337c48821313111dc751 (patch) | |
tree | 21b46eb4637ead189d6abdfd9194d0f7543efb0e | |
parent | 1e4dc96d61d1e1309b7117f0304a8ba161666f40 (diff) | |
download | busybox-w32-6077d90c26b1e102a6bb337c48821313111dc751.tar.gz busybox-w32-6077d90c26b1e102a6bb337c48821313111dc751.tar.bz2 busybox-w32-6077d90c26b1e102a6bb337c48821313111dc751.zip |
cp: make -P a synonym for -d
-rw-r--r-- | coreutils/cp.c | 8 | ||||
-rw-r--r-- | include/usage.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c index 6a82f6bff..97731e83f 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #include "libcoreutils/coreutils.h" | 42 | #include "libcoreutils/coreutils.h" |
43 | 43 | ||
44 | /* WARNING!! ORDER IS IMPORTANT!! */ | 44 | /* WARNING!! ORDER IS IMPORTANT!! */ |
45 | static const char cp_opts[] = "pdRfiar"; | 45 | static const char cp_opts[] = "pdRfiarP"; |
46 | 46 | ||
47 | extern int cp_main(int argc, char **argv) | 47 | extern int cp_main(int argc, char **argv) |
48 | { | 48 | { |
@@ -73,6 +73,12 @@ extern int cp_main(int argc, char **argv) | |||
73 | */ | 73 | */ |
74 | flags |= FILEUTILS_RECUR; | 74 | flags |= FILEUTILS_RECUR; |
75 | } | 75 | } |
76 | if (flags & 128) { | ||
77 | /* Make -P a synonym for -d, | ||
78 | * -d is the GNU option while -P is the POSIX 2003 option | ||
79 | */ | ||
80 | flags |= FILEUTILS_DEREFERENCE; | ||
81 | } | ||
76 | 82 | ||
77 | flags ^= FILEUTILS_DEREFERENCE; /* The sense of this flag was reversed. */ | 83 | flags ^= FILEUTILS_DEREFERENCE; /* The sense of this flag was reversed. */ |
78 | 84 | ||
diff --git a/include/usage.h b/include/usage.h index d928a10a3..7cf44d74a 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -204,7 +204,7 @@ | |||
204 | "Copies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n" \ | 204 | "Copies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n" \ |
205 | "\n" \ | 205 | "\n" \ |
206 | "\t-a\tSame as -dpR\n" \ | 206 | "\t-a\tSame as -dpR\n" \ |
207 | "\t-d\tPreserves links\n" \ | 207 | "\t-d,-P\tPreserves links\n" \ |
208 | "\t-p\tPreserves file attributes if possible\n" \ | 208 | "\t-p\tPreserves file attributes if possible\n" \ |
209 | "\t-f\tforce (implied; ignored) - always set\n" \ | 209 | "\t-f\tforce (implied; ignored) - always set\n" \ |
210 | "\t-i\tinteractive, prompt before overwrite\n" \ | 210 | "\t-i\tinteractive, prompt before overwrite\n" \ |