Subject: Re: /bin/cp broken
To: Christos Zoulas <christos@astron.com>
From: Neil Booth <neil@daikokuya.co.uk>
List: current-users
Date: 11/17/2005 07:44:28
Christos Zoulas wrote:-

> In article <200511161418.52634.sverre@viewmark.com>,
> Sverre Froyen  <sverre@viewmark.com> wrote:
> >Hi,
> >
> >Looks like this is fallout from the change to src/lib/libc/gen/fts.c.  
> >Reverting to version 1.25 makes cp behave normally.
> >
> >Sverre
> 
> Well, depends what you mean normally. Typically in BSD saying "foo/" means
> the same as "foo/.". cp behaved inconsistently before. FreeBSD for example
> copies the contents of a directory when the directory has a trailing slash
> (and documents this in the manual page). Linux does not. I don't see the
> missing last character you mention.

Something else that is odd:

$ cp -R commands/ ..

copies the files in commands/ (less final char) to the parent directory
whereas

$ cp -R commands ..

copies the directory to the parent directory (with final char and
final char in copied files therein intact).

But:

$ cp -R commands/ .
cp: ./commands and commands are identical (not copied).
$ cp -R commands .
cp: ./commands and commands are identical (not copied).
cp: ./commands and commands are identical (not copied).
$

Here the latter complains twice (there are two files in commands/;
presumably one complaint per file), and *both* commands copy those
two files to the current directory, regardless of the error messages,
*without* the final character.

It seems really messed up at the moment.

Neil.