diff options
-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)); } /* |