From: Jim Meyering Date: Thu, 5 Sep 1996 23:19:33 +0000 (+0000) Subject: (do_copy): When concatenating DEST (with a trailing `/') and the basename X-Git-Tag: TEXTUTILS-1_19d~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63a48d0278c477af323a306197dd2c590f4960b4;p=thirdparty%2Fcoreutils.git (do_copy): When concatenating DEST (with a trailing `/') and the basename part of non-directory SOURCE, don't add a slash between them. --- diff --git a/src/cp.c b/src/cp.c index 2942535031..98894a3dd4 100644 --- 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 {