]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(do_copy): Describe in a little more detail the code
authorJim Meyering <jim@meyering.net>
Tue, 10 Sep 1996 03:05:15 +0000 (03:05 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 10 Sep 1996 03:05:15 +0000 (03:05 +0000)
that makes `cp non-directory file/' (eventually) fail.

src/cp.c

index 74b7c2d9615de40076d6bf97f2021ff946d44043..d61ed580314a6ea6e391b02e53f1dfca501bd65c 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -520,7 +520,9 @@ do_copy (int argc, char **argv)
 
       /* When the destination is specified with a trailing slash and the
         source exists but is not a directory, convert the user's command
-        `cp source dest/' to `cp source dest/basename(source)'.  */
+        `cp source dest/' to `cp source dest/basename(source)'.  Doing
+        this ensures that the command `cp non-directory file/' will now
+        fail rather than performing the copy.  */
 
       else if (dest[strlen (dest) - 1] == '/'
          && lstat (source, &source_stats) == 0