Comment 10 for bug 154602

Revision history for this message
C de-Avillez (hggdh2) wrote :

A bit of update on this (from the coreutils ML; the mini-thread (so far) can be seen here: http://lists.gnu.org/archive/html/bug-coreutils/2009-03/msg00469.html.

---------begin email---------
> I'm confident that POSIX does not require
> cp -r dir dir to create dir/dir ;-)

That's certainly true: an implementation is clearly allowed to (but not
required to) report an error and exit without doing anything when it
sees this example. However, that's not what GNU cp does, which raises
the issue.

As near as I can figure out, this is a hole in POSIX. It nowhere
specifies what "cp" should do when inputs and outputs overlap, which
they can in even-more-interesting ways than "cp -R dir dir". Perhaps
this should be raised with the POSIX folks, but in the meantime I don't
see that GNU cp needs to change as far as conformance goes.
---------end email---------

Also, from Jens' previous comment:

"And yes, I absolutely believe that it makes good sense to keep this
open as a tracking bug here, and to take it up with upstream. And
--apologies again-- but I'm sceptical of the declaration that the GNU
project would not want to change this; asking won't hurt."

Jim is the upstream maintainer for coreutils, so he already answered it: upstream is not going to run and, er, correct it, but are very willing to accept such a patch. If it helps any, my personal (and meager) experience with upstream is that they will help on getting a patch.

So. The offer is open. Anyone willing to write such a patch, please feel welcome.