diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2008-06-13 20:07:41 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2008-06-13 20:07:41 +0000 |
commit | 27669eaa9540ef8f7602290f876ab647fa0f7a8f (patch) | |
tree | 5aaf1be7a95306d6d14090969224d7618b8e18ae | |
parent | caa47d9de6f7aa5b73ac1a14b51a10ffa6de0b48 (diff) |
One more "//" instead of "/" case. Hidden in a getcwd.
Noted, ok otto@
-rw-r--r-- | usr.bin/mg/dir.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mg/dir.c b/usr.bin/mg/dir.c index e96e8e2049d..235277398ad 100644 --- a/usr.bin/mg/dir.c +++ b/usr.bin/mg/dir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.c,v 1.18 2007/05/28 17:52:17 kjell Exp $ */ +/* $OpenBSD: dir.c,v 1.19 2008/06/13 20:07:40 kjell Exp $ */ /* This file is in the public domain. */ @@ -24,7 +24,8 @@ dirinit(void) ewprintf("Can't get current directory!"); chdir("/"); } - (void)strlcat(mgcwd, "/", sizeof(mgcwd)); + if (!(mgcwd[0] == '/' && mgcwd [1] == '\0')) + (void)strlcat(mgcwd, "/", sizeof(mgcwd)); } /* |