diff options
author | Steve Price <steve@FreeBSD.org> | 1998-05-25 22:44:16 +0000 |
---|---|---|
committer | Steve Price <steve@FreeBSD.org> | 1998-05-25 22:44:16 +0000 |
commit | 191b38b5fa9d4a6621e996d6c2358029cef0d62c (patch) | |
tree | 7680ed91f7129887f30ec8048ae7d54da2539bc7 /bin/mv | |
parent | e5a8a007e163e2dc2dcba9cabcabc1279f351686 (diff) | |
download | src-191b38b5fa9d4a6621e996d6c2358029cef0d62c.tar.gz src-191b38b5fa9d4a6621e996d6c2358029cef0d62c.zip |
Don't append a '/' to the destination directory if there
is already one there.
PR: 3025
Notes
Notes:
svn path=/head/; revision=36383
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 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 <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 |