1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-30 08:19:09 +00:00

Don't append a '/' to the destination directory if there

is already one there.

PR:		3025
This commit is contained in:
Steve Price 1998-05-25 22:44:16 +00:00
parent e5a8a007e1
commit 191b38b5fa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36383

View File

@ -45,7 +45,7 @@ static char const copyright[] =
static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94";
#endif
static const char rcsid[] =
"$Id$";
"$Id: mv.c,v 1.18 1998/05/15 06:25:17 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -115,8 +115,10 @@ main(argc, argv)
(void)strcpy(path, argv[argc - 1]);
baselen = strlen(path);
endp = &path[baselen];
*endp++ = '/';
++baselen;
if (!baselen || *(endp - 1) != '/') {
*endp++ = '/';
++baselen;
}
for (rval = 0; --argc; ++argv) {
/*
* Find the last component of the source pathname. It