From 191b38b5fa9d4a6621e996d6c2358029cef0d62c Mon Sep 17 00:00:00 2001 From: Steve Price Date: Mon, 25 May 1998 22:44:16 +0000 Subject: [PATCH] Don't append a '/' to the destination directory if there is already one there. PR: 3025 --- bin/mv/mv.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 5d821772d060..2963cffa18f4 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -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 @@ -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