From 8f4f4514ccfa8b6ce94d18af0ca1015aeedc6000 Mon Sep 17 00:00:00 2001 From: steve Date: Mon, 25 May 1998 22:44:16 +0000 Subject: 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(-) (limited to 'bin/mv') diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 5d82177..2963cff 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 -- cgit v1.1