]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(do_copy): When concatenating DEST (with a trailing `/') and the basename
authorJim Meyering <jim@meyering.net>
Thu, 5 Sep 1996 23:19:33 +0000 (23:19 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 5 Sep 1996 23:19:33 +0000 (23:19 +0000)
part of non-directory SOURCE, don't add a slash between them.

src/cp.c

index 2942535031502a1572c6a2037398631f1796af53..98894a3dd4bd7afc1c86d2b5ea764566cf90cecf 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -529,9 +529,9 @@ do_copy (int argc, char **argv)
          strip_trailing_slashes (tmp_source);
          source_base = basename (tmp_source);
 
-         new_dest = (char *) alloca (strlen (dest) + 1 +
-                                     strlen (source_base) + 1);
-         stpcpy (stpcpy (stpcpy (new_dest, dest), "/"), source_base);
+         new_dest = (char *) alloca (strlen (dest)
+                                     strlen (source_base) + 1);
+         stpcpy (stpcpy (new_dest, dest), source_base);
        }
       else
        {