diff options
author | steve <steve@FreeBSD.org> | 1998-05-25 22:44:16 +0000 |
---|---|---|
committer | steve <steve@FreeBSD.org> | 1998-05-25 22:44:16 +0000 |
commit | 8f4f4514ccfa8b6ce94d18af0ca1015aeedc6000 (patch) | |
tree | ee8cd809226094d04e8ef0169b43448fb31a4f4d /bin/mv | |
parent | ba8f020407e5e217f39a38087c3a46f8d5c06663 (diff) | |
download | FreeBSD-src-8f4f4514ccfa8b6ce94d18af0ca1015aeedc6000.zip FreeBSD-src-8f4f4514ccfa8b6ce94d18af0ca1015aeedc6000.tar.gz |
Don't append a '/' to the destination directory if there
is already one there.
PR: 3025
Diffstat (limited to 'bin/mv')
-rw-r--r-- | bin/mv/mv.c | 8 |
1 files changed, 5 insertions, 3 deletions
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 <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 |