cp: Rename -d option to -P

The -d option is a GNU extension and is equivalent to its "-P
--preserve=links" options.

Since we don't implement the --preserve=links functionality anyway (it
means preserve hard links between files), just call it -P, which is
specified by POSIX.

Additionally, there is no need to check for cp_Pflag again before
copying the symlink itself because the only way the mode in the stat
will indicate a symlink is if we used lstat (which we only do if -P is
specified).
This commit is contained in:
Michael Forney
2014-12-08 03:25:24 +00:00
committed by sin
parent 573ef00c91
commit e14e0becce
4 changed files with 11 additions and 11 deletions

6
cp.c
View File

@@ -19,10 +19,10 @@ main(int argc, char *argv[])
ARGBEGIN {
case 'a':
/* implies -dpr */
cp_aflag = cp_dflag = cp_pflag = cp_rflag = 1;
cp_aflag = cp_Pflag = cp_pflag = cp_rflag = 1;
break;
case 'd':
cp_dflag = 1;
case 'P':
cp_Pflag = 1;
break;
case 'p':
cp_pflag = 1;