diff -Nrup fileutils-4.1-2.old/src/copy.c fileutils-4.1-2.new/src/copy.c --- fileutils-4.1-2.old/src/copy.c 2001-06-25 23:42:46.000000000 +0100 +++ fileutils-4.1-2.new/src/copy.c 2004-02-21 17:34:32.742569600 +0000 @@ -197,6 +197,14 @@ copy_reg (const char *src_path, const ch source_desc = open (src_path, O_RDONLY); if (source_desc < 0) { +#ifndef __CYGWIN__ + /* The following comment is incorrect. + The code that would have deferred the same-name check until + here is commented out in same_file_ok. + So in most environments, errno == ENOENT will never happen. + In Cygwin, this happens because of the different + handling of .exe in stat and open. + The error message for non-ENOENT errors is probably better. */ /* If SRC_PATH doesn't exist, then chances are good that the user did something like this `cp --backup foo foo': and foo existed to start with, but copy_internal renamed DST_PATH @@ -205,6 +213,7 @@ copy_reg (const char *src_path, const ch error (0, 0, _("%s and %s are the same file"), quote_n (0, src_path), quote_n (1, dst_path)); else +#endif error (0, errno, _("cannot open %s for reading"), quote (src_path)); return -1;