[Patch] bin/cp sync with FreeBSD

Sarunas Vancevicius svan at redbrick.dcu.ie
Thu Feb 3 09:05:44 PST 2005


Hi,

This patch[1] syncs with FreeBSD cp, in particular:

- pass -1 to setfile

 Rev: cp.c:1.49

- When -R is not specified, fail to copy the contents of dangling
  symlinks instead of making a copy of the link itself (SUSv3). 
  
  Rev: cp.c:1.36
  
- Trailing slash fixes.

 Fix the case:
 
    cp file nonexistent/

 Which creates nonexistent as file while trailing slash clearly
 indicates that nonexistent must be a directory.
 
 Also fix the case:
 
    cp file1 file2/

 which should produce an error.

 Rev: cp.c:1.34

Sarunas

[1] http://www.redbrick.dcu.ie/~svan/dfly/cp.c.diff






More information about the Submit mailing list