History log of /freebsd-current/bin/cp/cp.c
Revision Date Author Comments
# f070188c 16-Apr-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

cp: Use warnc().

MFC after: 1 week
Sponsored by: Klara, Inc.


# 64d6925d 16-Apr-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

cp: Clarify an obscure comment.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D44805


# 0729d1e8 08-Apr-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

cp: Never follow symbolic links in destination.

Historically, BSD cp has followed symbolic links in the destination
when copying recursively, while GNU cp has not. POSIX is somewhat
vague on the topic, but both interpretations are within bounds. In
33ad990ce974, cp was changed to apply the same logic for symbolic
links in the destination as for symbolic links in the source: follow
if not recursing (which is moot, as this situation can only arise
while recursing) or if the `-L` option was given. There is no support
for this in POSIX. We can either switch back, or go all the way.

Having carefully weighed the kind of trouble you can run into by
following unexpected symlinks up against the kind of trouble you can
run into by not following symlinks you expected to follow, we choose
to go all the way.

Note that this means we need to stat the destination twice: once,
following links, to check if it is or references the same file as the
source, and a second time, not following links, to set the dne flag
and determine the destination's type.

While here, remove a needless complication in the dne logic. We don't
need to explicitly reject overwriting a directory with a non-directory,
because it will fail anyway.

Finally, add test cases for copying a directory to a symlink and
overwriting a directory with a non-directory.

MFC after: never
Relnotes: yes
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D44578


# dd286b0d 01-Apr-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

cp: Improved conformance when copying directories.

* When copying a directory, if the destination exists and is not a
directory, we would previously emit an error message and exit. The
correct behavior according to POSIX is to emit an error message and
continue without descending further into the source directory.

* When copying a directory, if the destination does not exist and we
fail to create it, we would previously emit an error message and
exit. The correct behavior according to POSIX is to emit an error
message and continue. Whether to descend further into the source
directory is explicitly left unspecified; GNU cp does not, which
seems to me to be the safer and less surprising option, so let's not
either.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D44577


# 5aaef5a6 28-Mar-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

cp: Fix grammar in comment.

This reverts commit 416fdc2d71656e2f0b4a16828fb0c736ae32b74a.


# 416fdc2d 11-Jan-2024 Chia-Jung Chang <maluma110020036@gapp.nthu.edu.tw>

cp(1): Grammar fix in comment

Event: Advanced UNIX programming course (Fall'23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1033


# e9910377 03-Jan-2024 rilysh <nightquick@proton.me>

bin/cp: remove unreachable break

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/872


# 0f4467ce 14-Dec-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

cp: Move the flags around a bit.

- The HLPR flags are grouped together at the beginning because they are
the standard flags for programs using FTS. Move the N flag out from
among them to its correct place in the sequence.
- The Pflag variable isn't used outside main(), but moving it out lets
us skip initialization and keeps it with its friends H, L and R.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43063


# 5a52e3d0 07-Dec-2023 Warner Losh <imp@FreeBSD.org>

cp: Add -N flag, inspired by NetBSD's similar flag

Add -N to supress copying of file flags when -p is specified (explicitly
or implicitly). Often times we don't care about the flags or wish to be
able to copy to NFS, and this comes in handy for that. FreeBSD's and
NetBSD's cp are somewhat different, so I had to reimplement all but one
of the patch hunks...

Obtained from: NetBSD (cp.1 1.25, cp.c 1.37, utils.c 1.28 by elad)
Sponsored by: Netflix

Differential Revision: https://reviews.freebsd.org/D42673


# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by: Netflix


# 90aea514 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# cb96a0ef 03-Feb-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

cp: Minor code cleanup.

* Fix includes in utils.c, cf. style(9).
* Fix type mismatch: readlink(2) returns ssize_t, not int.
* It is not necessary to set errno to 0 as fts_read(3) already does it.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D38369


# f00f8b4f 05-Apr-2022 Kyle Evans <kevans@FreeBSD.org>

cp: fix -R recursion detection

The correct logic is a lot simpler than the previous iteration. We
record the base fts_name to avoid having to worry about whether we
needed the root symlink name or not (as applicable), then we can simply
shift all of that logic to after path translation to make it less
fragile.

If we're copying to DNE, then we'll have swapped out the NULL root_stat
pointer and then attempted to recurse on it. The previously nonexistent
directory shouldn't exist at all in the new structure, so just back out
from that tree entirely and move on.

The tests have been amended to indicate our expectations better with
subdirectory recursion. If we copy A to A/B, then we expect to copy
everything from A/B/* into A/B/A/B, with exception to the A that we
create in A/B.

Reviewed by: bapt
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D34655


# 97e13037 22-Feb-2022 Cameron Katri <me@cameronkatri.com>

cp: Make -P work without -R as per POSIX

According to POSIX, cp should allow the `-P` flag to work whether `-R`
is specified or not. Currently, the `-P` option only works along with
`-R`.

PR: 199466
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D30012


# 33ad990c 26-Jan-2022 Kyle Evans <kevans@FreeBSD.org>

cp: fix -R with links

The traversal was previously not properly honoring -H/-L/-P. Notably,
we should not have been resolving symlinks encountered during traversal
when either -H or -P are specified.

Sponsored by: Klara, Inc.
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D34063


# 848263aa 26-Jan-2022 Kyle Evans <kevans@FreeBSD.org>

cp: fix some cases with infinite recursion

As noted in the PR, cp -R has some surprising behavior. Typically, when
you `cp -R foo bar` where both foo and bar exist, foo is cleanly copied
to foo/bar. When you `cp -R foo foo` (where foo clearly exists), cp(1)
goes a little off the rails as it creates foo/foo, then discovers that
and creates foo/foo/foo, so on and so forth, until it eventually fails.

POSIX doesn't seem to disallow this behavior, but it isn't very useful.
GNU cp(1) will detect the recursion and squash it, but emit a message in
the process that it has done so.

This change seemingly follows the GNU behavior, but it currently doesn't
warn about the situation -- the author feels that the final product is
about what one might expect from doing this and thus, doesn't need a
warning. The author doesn't feel strongly about this.

PR: 235438
Reviewed by: bapt
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D33944


# 2dfa4b66 08-Dec-2020 Bryan Drewery <bdrewery@FreeBSD.org>

fts_read: Handle error from a NULL return better.

This is addressing cases such as fts_read(3) encountering an [EIO]
from fchdir(2) when FTS_NOCHDIR is not set. That would otherwise be
seen as a successful traversal in some of these cases while silently
discarding expected work.

As noted in r264201, fts_read() does not set errno to 0 on a successful
EOF so it needs to be set before calling it. Otherwise we might see
a random error from one of the iterations.

gzip is ignoring most errors and could be improved separately.

Reviewed by: vangyzen
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27184


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# 724fd448 08-Jun-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Cleanup some style(9) issues.

- Whitespace.
- Comments.
- Wrap long lines.

MFC after: 2 weeks
X-MFC-with: r284105,r284106
Sponsored by: EMC / Isilon Storage Division


# 7ea2450f 07-Jun-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Implement '-s' to copy as symlink, similar to the current -l link(2) handling.

This is also implemented in at least GNU coreutils cp.

While here also improve the '-l' handling to not open(2) the source file as
it does not actually need the descriptor.

Sponsored by: EMC / Isilon Storage Division


# c633f8dc 05-May-2015 Jilles Tjoelker <jilles@FreeBSD.org>

cp: Remove fts sorting.

In an attempt to improve performance, cp reordered directories first
(although the comment says directories last). This is not effective with new
UFS layout policies.

The sorting reorders multiple arguments passed to cp, which may be
undesirable.

Additionally, the comparison function does not induce a total order. Per
POSIX, this causes undefined behaviour in qsort().

NetBSD removed the sorting in 2009.

On filesystems that return directory entries in hash/btree order, sorting by
d_fileno before statting improves performance on large directories. However,
this can only be implemented in fts(3).

PR: 53475
Reviewed by: bde (in 2004)
MFC after: 1 week


# 76d916f1 16-Jan-2013 Eitan Adler <eadler@FreeBSD.org>

Remove useless variable 'Pflag':
-P is an alternative to -H and -L, and it is implemented using the Hflag and Lflag variables.

Approved by: cperciva
MFC after: 3 days


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 9fa5f90f 05-Jun-2010 Edward Tomasz Napierala <trasz@FreeBSD.org>

Don't try to copy a socket after "xxx is a socket (not copied)." message.
Previously, it would either try to copy it anyway and fail (without -R),
or create fifo instead of the socket (with -R).

Found with: Coverity Prevent
CID: 5623
MFC after: 2 weeks


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 3d4d4693 16-Feb-2010 Gavin Atkinson <gavin@FreeBSD.org>

Merge r202461 from head:

Implement an "-x" option to cp(1), for compatibility with Linux and
feature parity with du(1) and similar: When set, cp(1) will not traverse
mount points.

PR: bin/88056
Initial patch by: Graham J Lee leeg teaching.physics.ox.ac.uk


# f815125f 17-Jan-2010 Gavin Atkinson <gavin@FreeBSD.org>

Implement an "-x" option to cp(1), for compatibility with Linux and
feature parity with du(1) and similar: When set, cp(1) will not traverse
mount points.

Initial patch by: Graham J Lee leeg teaching.physics.ox.ac.uk

PR: bin/88056
Initial patch by: Graham J Lee leeg teaching.physics.ox.ac.uk
Approved by: ed (mentor)
MFC after: 1 month


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# d140946c 10-Mar-2008 John Baldwin <jhb@FreeBSD.org>

Add an '-a' option which is identical to specifying '-RpP' for
compatibility with other implementations.

MFC after: 1 month


# a76b9b69 26-Dec-2007 Edwin Groothuis <edwin@FreeBSD.org>

As suggested, replace earlier changed warnx() / exit() with an errx()

Submitted by: Peter Jeremy <peterjeremy@optushome.com.au>


# 0d5ee457 24-Dec-2007 Edwin Groothuis <edwin@FreeBSD.org>

When copying multiple files to a directory, make sure that a proper
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@


# 43d8847e 11-Oct-2006 Tom Rhodes <trhodes@FreeBSD.org>

Fix style(9) bugs in previous commit.

Lesson from: bde


# ba3fe6d1 07-Oct-2006 Tom Rhodes <trhodes@FreeBSD.org>

Make -r a synonym for -R, similar to behavior on Linux while being backwards
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)


# 64941e9d 29-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

Move the -l option processing to where it belongs.
Overall still not kosher but better matches style(9).


# 6fa36377 24-Aug-2006 Julian Elischer <julian@FreeBSD.org>

Add an option to allow copying of a hierarchy while linking he regular files.
Bikeshedded to death on: hackers
Submitted by:andersonatcenttech.com
MFC in: 1 month


# 867e6caf 04-Jul-2006 Maxim Konovalov <maxim@FreeBSD.org>

o Call fts_close() before exit.

Obtained from: NetBSD, Coverity ID 1754


# 9b4261c9 04-Sep-2005 Christian S.J. Peron <csjp@FreeBSD.org>

Attempt to complete the userspace integration of POSIX.1e extended ACLs.
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


# 9ddb49cb 10-Jan-2005 Warner Losh <imp@FreeBSD.org>

/*- or .\"- or #- to begin license clauses.


# 6195fb41 06-Apr-2004 Mark Murray <markm@FreeBSD.org>

Remove clause 3 from the UCB licenses.

OK'ed by: imp, core


# 529a7167 30-Jun-2003 John-Mark Gurney <jmg@FreeBSD.org>

pass -1 to setfile in cp.c

Submitted by: Jun Kuriyama


# 09a80d48 01-May-2003 David E. O'Brien <obrien@FreeBSD.org>

Quiet warnings about copyright[].


# 82fdc5e6 13-Apr-2003 Bruce Evans <bde@FreeBSD.org>

Include <signal.h> instead of depending on namespace pollution in
<sys/param.h>. Include <sys/types.h> instead of of <sys/param.h>
so that further such dependencies don't develop.


# 4901f51b 13-Apr-2003 Bruce Evans <bde@FreeBSD.org>

Fixed some style bugs in rev.1.44.


# 947193d9 06-Apr-2003 Matthew N. Dodd <mdodd@FreeBSD.org>

Use the correct data type and qualifier for signal flag.


# 00d321a2 07-Apr-2003 Matthew N. Dodd <mdodd@FreeBSD.org>

Add a SIGINFO handler.


# ba8acd9d 18-Oct-2002 Mark Murray <markm@FreeBSD.org>

Constify and staticify for lint.


# eedc99e7 22-Sep-2002 Stephen McKay <mckay@FreeBSD.org>

cp -p could report success even if a file copy failed. This was due to
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


# 0d3bcc2e 20-Sep-2002 Garrett Wollman <wollman@FreeBSD.org>

Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the struct
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


# 786c276f 22-Jul-2002 Johan Karlsson <johan@FreeBSD.org>

Add the -n option, which automatically answers "no" to the overwrite question.

PR: 7828
Suggested by: Daniel O'Connor <doconnor@gsoft.com.au>
Approved by: sheldonh (mentor)
MFC after: 2 weeks


# 5ad9e45f 10-Jul-2002 Matthew Dillon <dillon@FreeBSD.org>

err() is documented as allowing NULL for the format string but GCC isn't
happy about it any more so change the usage to make buildworld work again.


# 7ede89e4 03-Jul-2002 Mark Murray <markm@FreeBSD.org>

Fix some low-hanging lint-fruit: endianness and staticness warnings.


# 5eb43ac2 29-Jun-2002 David E. O'Brien <obrien@FreeBSD.org>

Consistently use __FBSDID


# f9dc2a8b 13-Jun-2002 Tim J. Robbins <tjr@FreeBSD.org>

When -R is not specified, fail to copy the contents of dangling symlinks
instead of making a copy of the link itself (SUSv3)

Obtained from: NetBSD


# 486d0387 16-May-2002 Andrey A. Chernov <ache@FreeBSD.org>

Optimize prev. commit code a bit


# 27d3ae35 17-May-2002 Andrey A. Chernov <ache@FreeBSD.org>

Trailing slash fixes.

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.


# 64baebf9 10-May-2002 Alfred Perlstein <alfred@FreeBSD.org>

Add semicolon to empty default case to silence warning.


# 8bd08b5f 22-Feb-2002 Mark Murray <markm@FreeBSD.org>

Fix warnings inspired by lint, a commercial lint and WARNS=4.


# 5dce647c 01-Feb-2002 Warner Losh <imp@FreeBSD.org>

Modernization effort for bin/c*:

o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.

Approved by: arch@, new style(9)


# 16ef4ac3 31-Dec-2001 Stephen McKay <mckay@FreeBSD.org>

Bruce thought some of the comments I added were not clear enough. This is
a combination of my words and his. We will stop fiddling now. :-)


# 62de071b 23-Dec-2001 Stephen McKay <mckay@FreeBSD.org>

The previous fix caused cp to emit spurious warnings under some
circumstances. This is a reworked version of the same fix, that does
not have this defect, and which fixes some style bugs at the same time.

Bug reported and fix reviewed by: bde


# 4a5db7ac 11-Dec-2001 Stephen McKay <mckay@FreeBSD.org>

Preserve directory timestamps with -p. Allow non-empty read-only
directories to be copied. Apply umask to newly created directories
when -p is not specified.

PR: 27970
PR: 31633

MFC after: 4 days


# 26f6b0fb 19-Jun-2001 Dag-Erling Smørgrav <des@FreeBSD.org>

Add more headers that are required with -fno-builtin (stdlib and strings)


# e1d071db 11-Jun-2001 Bruce Evans <bde@FreeBSD.org>

Removed the broken code which claimed to lose the set[ug]id bits in
the !(pflag && setfile()) case for regular files unless the copy is
owned by the same user and group. These bits have already been lost
(or never gained) in the correct way. The code didn't actually lose
the bits; it depended on them being lost already (apparently in all
cases) and attempted to gain them as necessary, but it often gained
them (and sometimes collateral bits) when wrong:
- pflag && setfile() == 0 case (i.e., for a successful cp -p):
setfile() copies all the attributes as correctly as possible (as
specified by POSIX), and we sometimes messed up the up the mode by
setting it again. Also, if the file is immutable, then setting the
mode again gave spurious errors (PR 20646).
- !pflag case. If the target is created, POSIX requires it to not
have the set[ug]id bits, but we sometimes copied them from the source.
If the target already exists, POSIX requires its mode to be unchanged,
but we sometimes copied the whole mode from the source.

PR: 20646
MFC after: 4 weeks


# 34f9c106 16-May-2001 Warner Losh <imp@FreeBSD.org>

Migrate from using MAXPATHLEN to MAX_PATH. Use strlcpy to copy the
strings.


# 0efa2040 28-Nov-1999 Michael Haro <mharo@FreeBSD.org>

brucify

Reviewed by: obrien


# fcb2f1b3 29-Aug-1999 Michael Haro <mharo@FreeBSD.org>

brucify and move printf() to catch cases of special files


# 2a456239 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 4506e907 25-Aug-1999 Michael Haro <mharo@FreeBSD.org>

Add a verbose mode to show what files are being copied.
Idea taken from obrien.

Reviewed by: obrien


# 1f2dedd8 09-Jul-1999 Kris Kennaway <kris@FreeBSD.org>

Add -W and fix the warning due to missing struct initializer


# 46be34b9 08-May-1999 Kris Kennaway <kris@FreeBSD.org>

Various spelling/formatting changes.

Submitted by: Philippe Charnier <charnier@xp11.frmug.org>


# 426e9c1d 25-Apr-1999 Warner Losh <imp@FreeBSD.org>

First set of fixes to keep egcs happy. These include {} around single
statement if blocks[*] when the else could be ambiguous, not defaulting
to int type and removal of some unused variables.

[*] This is explicitly allowed by style(9) when the single statement
spans more than one line.

Reviewed by: obrien, chuckr


# f6fa1b35 09-Jun-1998 Dmitrij Tejblum <dt@FreeBSD.org>

Print correct error message if we copy an unreadable directory.


# c194af34 13-May-1998 Philippe Charnier <charnier@FreeBSD.org>

Restore Lite-2 sccsid.


# cbf6f7d3 06-May-1998 Philippe Charnier <charnier@FreeBSD.org>

Correct use of .Nm and other cosmetics. Add rcsid. Remove unused #inc.


# c4694019 01-Jul-1997 Bruce Evans <bde@FreeBSD.org>

Import Lite2's src/bin. All files in src/bin are off the vendor branch,
so this doesn't change the active versions.


# 93ef08af 28-Mar-1997 Warner Losh <imp@FreeBSD.org>

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# b97fa2ef 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 890acb95 13-Dec-1996 Steve Price <steve@FreeBSD.org>

Merge Lite2 mods and -Wall cleaning.


# 6add522f 07-Mar-1996 Wolfram Schneider <wosch@FreeBSD.org>

Option -f implemented (remove + create)
option -f and -i are exclusive
respond `Y' is equal to `y'
fix usage string
remove isatty(3) check

Reviewed by: pst


# ee4f505e 18-Feb-1996 Paul Traina <pst@FreeBSD.org>

Don't initialize udata, remove bogus case, fix usage string


# d7e0e5ca 18-Feb-1996 Wolfram Schneider <wosch@FreeBSD.org>

delete my last commit
Submitted by: pst, ache


# d6ea04cc 18-Feb-1996 Wolfram Schneider <wosch@FreeBSD.org>

Option -f implemented (remove + create)
option -f and -i are exclusive
all flag variables initialized with zero
respond `Y' is equal to `y'
update usage string


# 2162b2d2 29-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.

Reviewed by: phk


# 439b2b1e 01-Apr-1995 Bruce Evans <bde@FreeBSD.org>

Add braces to fix wrong if-if-else-if nesting that broke `cp -pR' for
fifos.


# a829865d 25-Jan-1995 David Greenman <dg@FreeBSD.org>

Fix bogus format string; fixes problem reported by Wolfram Schneider.


# 7658fd20 30-Dec-1994 Bruce Evans <bde@FreeBSD.org>

Don't strip off the last slash in the pathname "/". cp used to
stat the pathname "" in order to decide that the pathname "/" is
a directory. This caused `cp kernel /' to fail if the kernel has
the POSIX behaviour of not allowing the pathname "" to be an alias
for ".". It presumably also caused `cp /etc/motd /' to fail in
the unlikely event that "." is not stat'able.

Be more careful about concatenating pathnames: don't check that
the pathname fits until prefixes have been discarded (the check
was too strict). Print the final pathname in error messages.
Terminate the target directory name properly for error messages.
Don't add a slash between components if there is already a slash.


# 89730b29 23-Sep-1994 David Greenman <dg@FreeBSD.org>

Added $Id$


# 4b88c807 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite bin Sources