aboutsummaryrefslogtreecommitdiff
path: root/bin/cp
Commit message (Collapse)AuthorAgeFilesLines
* Add an '-a' option which is identical to specifying '-RpP' forJohn Baldwin2008-03-103-5/+15
| | | | | | | | | compatibility with other implementations. MFC after: 1 month Notes: svn path=/head/; revision=177036
* As suggested, replace earlier changed warnx() / exit() with an errx()Edwin Groothuis2007-12-261-4/+3
| | | | | | | Submitted by: Peter Jeremy <peterjeremy@optushome.com.au> Notes: svn path=/head/; revision=174912
* When copying multiple files to a directory, make sure that a properEdwin Groothuis2007-12-251-1/+1
| | | | | | | | | | | | warning is given when the directory doesn't exist. PR: bin/50656 Submitted by: Edwin Groothuis <edwin@mavetju.org> Approved by: grog@ Not reviewed by: grog@ Notes: svn path=/head/; revision=174890
* Fix typo.Ceri Davies2006-11-021-1/+1
| | | | Notes: svn path=/head/; revision=163919
* Wording nits.Tom Rhodes2006-10-271-11/+7
| | | | Notes: svn path=/head/; revision=163716
* Flesh out the compatibility section a little bit. Bump doc date.Tom Rhodes2006-10-241-30/+20
| | | | Notes: svn path=/head/; revision=163666
* Fix style(9) bugs in previous commit.Tom Rhodes2006-10-111-7/+4
| | | | | | | Lesson from: bde Notes: svn path=/head/; revision=163233
* Make -r a synonym for -R, similar to behavior on Linux while being backwardsTom Rhodes2006-10-072-14/+41
| | | | | | | | | | | compatible with old -r behavior with regards to -L. You can now copy fifos and other special files with -r. Reviewed by: -standards (long ago), das, bde Approved by: bde (recently) Notes: svn path=/head/; revision=163109
* o Style(9).Maxim Konovalov2006-10-071-9/+7
| | | | | | | Submitted by: bde Notes: svn path=/head/; revision=163075
* o Avoid division by zero.Maxim Konovalov2006-10-071-3/+8
| | | | | | | | | o Place error checking code near to the syscall. Submitted by: bde Notes: svn path=/head/; revision=163074
* o Hold copied bytes counter in off_t. This prevents statisticsMaxim Konovalov2006-10-061-1/+1
| | | | | | | | | | | displayed by SIGINFO handler from overflow. PR: bin/104039 Submitted by: Geoffrey Giesemann MFC after: 2 weeks Notes: svn path=/head/; revision=163049
* Move the -l option processing to where it belongs.Ruslan Ermilov2006-09-291-4/+4
| | | | | | | Overall still not kosher but better matches style(9). Notes: svn path=/head/; revision=162763
* - Fix options order.Ruslan Ermilov2006-08-252-7/+7
| | | | | | | - Touch manpage's document date. Notes: svn path=/head/; revision=161608
* Remove a stray -a option that probably sneaked in from julian'sRuslan Ermilov2006-08-251-2/+2
| | | | | | | attempt to enter append mode twice in vi(1). :-) Notes: svn path=/head/; revision=161607
* Add an option to allow copying of a hierarchy while linking he regular files.Julian Elischer2006-08-244-82/+105
| | | | | | | | | Bikeshedded to death on: hackers Submitted by:andersonatcenttech.com MFC in: 1 month Notes: svn path=/head/; revision=161586
* o Call fts_close() before exit.Maxim Konovalov2006-07-041-0/+1
| | | | | | | Obtained from: NetBSD, Coverity ID 1754 Notes: svn path=/head/; revision=160098
* Attempt to complete the userspace integration of POSIX.1e extended ACLs.Christian S.J. Peron2005-09-053-1/+86
| | | | | | | | | | | | | | | | | This includes adding support for ACLs into cp(1) and mv(1) userspace utilities. For mv(1), if _PC_ACL_EXTENDED is in effect for the source AND destination operands, the destination file's ACLs shall reflect the source. For cp(1), if _PC_ACL_EXTENDED is in effect for both source and destination operands, and -p has been specified, the ACLs from the source shall be preserved on the destination. MFC after: 1 month Notes: svn path=/head/; revision=149790
* Fix a few markup nits in previous commit.Tom Rhodes2005-02-251-1/+3
| | | | | | | Noticed by: ru, who else? :) Notes: svn path=/head/; revision=142412
* Note how cp(1) handles directories ending in "/."Tom Rhodes2005-02-241-1/+5
| | | | | | | | PR: 75774 Submitted by: Mike Meyer <mwm@mired.org> (original version) Notes: svn path=/head/; revision=142346
* Sync program's usage() with manpage's SYNOPSIS.Ruslan Ermilov2005-02-091-2/+3
| | | | Notes: svn path=/head/; revision=141578
* Add the new standard EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-161-1/+1
| | | | | | | Sort standard sections in the (documented) preferred order. Notes: svn path=/head/; revision=140353
* /*- or .\"- or #- to begin license clauses.Warner Losh2005-01-102-1/+2
| | | | Notes: svn path=/head/; revision=139969
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-1/+2
| | | | Notes: svn path=/head/; revision=131484
* Plug file descriptor leak in implementation of -n option.Tim J. Robbins2004-06-051-0/+1
| | | | Notes: svn path=/head/; revision=130102
* Remove clause 3 from the UCB licenses.Mark Murray2004-04-064-16/+0
| | | | | | | OK'ed by: imp, core Notes: svn path=/head/; revision=127958
* Don't mmap(2) and munmap(2) zero-length files.Alan Cox2003-11-131-1/+2
| | | | | | | Submitted by: Wiktor Niesiobedzki <bsd@w.evip.pl> Notes: svn path=/head/; revision=122601
* pass -1 to setfile in cp.cJohn-Mark Gurney2003-06-301-1/+1
| | | | | | | Submitted by: Jun Kuriyama Notes: svn path=/head/; revision=117065
* support saving both user/group and permissions on symlinks (from PR)John-Mark Gurney2003-06-221-13/+20
| | | | | | | | | | | also fix a slight bogon that assumed an fd of 0 was not valid. Changed it to be -1. PR: bin/25017 Submitted by: Martin Kammerhofer Notes: svn path=/head/; revision=116673
* Clarify what -p option does.Ruslan Ermilov2003-06-071-11/+12
| | | | | | | | | Prodded by: marcel While here, spell the "set-{user,group}-ID bit" correctly. Notes: svn path=/head/; revision=115938
* Quiet warnings about copyright[].David E. O'Brien2003-05-011-2/+2
| | | | Notes: svn path=/head/; revision=114433
* Include <signal.h> instead of depending on namespace pollution inBruce Evans2003-04-131-1/+2
| | | | | | | | <sys/param.h>. Include <sys/types.h> instead of of <sys/param.h> so that further such dependencies don't develop. Notes: svn path=/head/; revision=113431
* Fixed some style bugs in rev.1.44.Bruce Evans2003-04-131-3/+2
| | | | Notes: svn path=/head/; revision=113430
* Use the correct data type and qualifier for signal flag.Matthew N. Dodd2003-04-072-2/+2
| | | | Notes: svn path=/head/; revision=113218
* Add a SIGINFO handler.Matthew N. Dodd2003-04-074-0/+45
| | | | Notes: svn path=/head/; revision=113209
* Constify and staticify for lint.Mark Murray2002-10-183-6/+6
| | | | Notes: svn path=/head/; revision=105395
* cp -p could report success even if a file copy failed. This was due toStephen McKay2002-09-221-3/+4
| | | | | | | | | | | | | | the cumulative exit status being overwritten when directory permissions were being set. This was particularly bad when called from mv(1) to perform a cross-device move as the original files were deleted even if the copy failed. Reported by: Slaven Rezic <slaven.rezic@berlin.de> Patch by: bde PR: 42789 Notes: svn path=/head/; revision=103801
* Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the structGarrett Wollman2002-09-211-2/+2
| | | | | | | | | | | | | | | | | | | hack, thereby allowing future extensions to the structure (e.g., for extended attributes) without rebreaking the ABI. FTSENT now contains a pointer to the parent stream, which fts_compar() can then take advantage of, avoiding the undefined behavior previously warned about. As a consequence of this change, the prototype of the comparison function passed to fts_open() has changed to reflect the required amount of constness for its use. All callers in the tree are updated to use the correct prototype. Comparison functions can now make use of the new parent pointer to access the new stream-specific private data pointer, which is intended to assist creation of reentrant library routines which use fts(3) internally. Not objected to in spirit by: -arch Notes: svn path=/head/; revision=103726
* Bump document date for the -n option.Johan Karlsson2002-08-161-1/+1
| | | | | | | Approved by: sheldonh (mentor) Notes: svn path=/head/; revision=101961
* mdoc(7) police: grammar.Ruslan Ermilov2002-08-091-1/+1
| | | | Notes: svn path=/head/; revision=101570
* Fix some easy WARNS.Mark Murray2002-07-311-4/+4
| | | | Notes: svn path=/head/; revision=101093
* Add the -n option, which automatically answers "no" to the overwrite question.Johan Karlsson2002-07-234-12/+35
| | | | | | | | | | PR: 7828 Suggested by: Daniel O'Connor <doconnor@gsoft.com.au> Approved by: sheldonh (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=100538
* Revert previous delta, which is not required with rev 1.5 ofSheldon Hearn2002-07-151-1/+0
| | | | | | | src/contrib/gcc/c-format.c . Notes: svn path=/head/; revision=100069
* Set WFORMAT=0, because our compiler currently complains about NULLSheldon Hearn2002-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | arg 2 to err() and friends, and warnings are promoted to errors. This allows the following revisions to be reverted: rev 1.39 src/bin/cp/cp.c rev 1.26 src/bin/chmod/chmod.c rev 1.40 src/bin/rm/rm.c The following revisions can already be reverted, because they were already covered by WFORMAT=0: rev 1.8 src/bin/ls/lomac.c rev 1.63 src/bin/ls/ls.c rev 1.8 src/bin/ps/lomac.c rev 1.34 src/bin/rcp/rcp.c Notes: svn path=/head/; revision=99767
* err() is documented as allowing NULL for the format string but GCC isn'tMatthew Dillon2002-07-101-1/+1
| | | | | | | happy about it any more so change the usage to make buildworld work again. Notes: svn path=/head/; revision=99744
* Fix some low-hanging lint-fruit: endianness and staticness warnings.Mark Murray2002-07-032-4/+6
| | | | Notes: svn path=/head/; revision=99363
* Consistently use __FBSDIDDavid E. O'Brien2002-06-302-4/+4
| | | | Notes: svn path=/head/; revision=99109
* When -R is not specified, fail to copy the contents of dangling symlinksTim J. Robbins2002-06-131-3/+11
| | | | | | | | | instead of making a copy of the link itself (SUSv3) Obtained from: NetBSD Notes: svn path=/head/; revision=98171
* Optimize prev. commit code a bitAndrey A. Chernov2002-05-171-4/+4
| | | | Notes: svn path=/head/; revision=96809
* Trailing slash fixes.Andrey A. Chernov2002-05-171-2/+12
| | | | | | | | | | | | | Fix the case: cp file nonexistent/ which create nonextstent as file while trailing slash clearly indicates that nonexistent must be a directory. Also fix the case: cp file1 file2/ which should produce error. Notes: svn path=/head/; revision=96808
* Add semicolon to empty default case to silence warning.Alfred Perlstein2002-05-111-0/+1
| | | | Notes: svn path=/head/; revision=96371