From 3fc07d456b155a8c8171c33db0d3bd1c1f63beb3 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 10 Sep 1996 03:05:15 +0000 Subject: (do_copy): Describe in a little more detail the code that makes `cp non-directory file/' (eventually) fail. --- src/cp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cp.c b/src/cp.c index 74b7c2d96..d61ed5803 100644 --- 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 -- cgit v1.2.3-70-g09d2