diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2005-01-11 17:19:17 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2005-01-11 17:19:17 +0000 |
commit | 9ac554a5227182d7de1f533bf91d84be68151c3d (patch) | |
tree | e0e92a26556962552e5c6a58e3a936e91f39716d | |
parent | 83750fba231e943a7b47c7f42c2fe0189ed033db (diff) |
no need to call realpath() in adjustname()
realpath returns an error if cwd is not writeable, and that is quite common
with NFS-mounted ~ and sudo mg /etc/something - annoying as hell. realpath
is not needed at all here, so zap it. vincent ok
-rw-r--r-- | usr.bin/mg/fileio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/mg/fileio.c b/usr.bin/mg/fileio.c index 7b846d7d683..627df0de0b6 100644 --- a/usr.bin/mg/fileio.c +++ b/usr.bin/mg/fileio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fileio.c,v 1.42 2004/07/09 13:50:40 vincent Exp $ */ +/* $OpenBSD: fileio.c,v 1.43 2005/01/11 17:19:16 henning Exp $ */ /* * POSIX fileio.c @@ -226,9 +226,9 @@ extern char *wdir; char * adjustname(const char *fn) { - static char fnb[MAXPATHLEN]; + static char path[MAXPATHLEN]; const char *cp; - char user[LOGIN_NAME_MAX + 1], path[MAXPATHLEN]; + char user[LOGIN_NAME_MAX + 1]; int len; path[0] = '\0'; @@ -265,7 +265,7 @@ adjustname(const char *fn) } strlcat(path, fn, sizeof path); - return (realpath(path, fnb)); + return (path); } #ifndef NO_STARTUP |