From 6077d90c26b1e102a6bb337c48821313111dc751 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 7 Jan 2005 00:56:47 +0000 Subject: cp: make -P a synonym for -d --- coreutils/cp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'coreutils') diff --git a/coreutils/cp.c b/coreutils/cp.c index 6a82f6b..97731e8 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c @@ -42,7 +42,7 @@ #include "libcoreutils/coreutils.h" /* WARNING!! ORDER IS IMPORTANT!! */ -static const char cp_opts[] = "pdRfiar"; +static const char cp_opts[] = "pdRfiarP"; extern int cp_main(int argc, char **argv) { @@ -73,6 +73,12 @@ extern int cp_main(int argc, char **argv) */ flags |= FILEUTILS_RECUR; } + if (flags & 128) { + /* Make -P a synonym for -d, + * -d is the GNU option while -P is the POSIX 2003 option + */ + flags |= FILEUTILS_DEREFERENCE; + } flags ^= FILEUTILS_DEREFERENCE; /* The sense of this flag was reversed. */ -- cgit v1.1