diff options
author | 2005-11-11 18:51:49 +0000 | |
---|---|---|
committer | 2005-11-11 18:51:49 +0000 | |
commit | 852441886d3067c8230684f32ea93bedbec09e8f (patch) | |
tree | 2bc1e462ba8e1b467ce09ad8a4fa622d9667a93d | |
parent | spacing (diff) | |
download | wireguard-openbsd-852441886d3067c8230684f32ea93bedbec09e8f.tar.xz wireguard-openbsd-852441886d3067c8230684f32ea93bedbec09e8f.zip |
Now that we have an editable minibuffer, revert parsing of
"//" and "/~" as '/' and '~' respectively. I know emacs does it,
but it is weird, and breaks things that foolishly use filenames
like "/tmp//crontab.xxxx".
Proddings from matthieu and deraadt. Error report from Bernd Ahlers.
-rw-r--r-- | usr.bin/mg/fileio.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/usr.bin/mg/fileio.c b/usr.bin/mg/fileio.c index 013e5535aaf..35604d56aae 100644 --- a/usr.bin/mg/fileio.c +++ b/usr.bin/mg/fileio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fileio.c,v 1.59 2005/11/11 18:40:51 deraadt Exp $ */ +/* $OpenBSD: fileio.c,v 1.60 2005/11/11 18:51:49 kjell Exp $ */ /* This file is in the public domain. */ @@ -260,24 +260,11 @@ char * adjustname(const char *fn) { static char fnb[MAXPATHLEN]; - const char *cp, *ep = NULL; + const char *cp; char user[LOGIN_NAME_MAX], path[MAXPATHLEN]; size_t ulen, plen; path[0] = '\0'; - - cp = fn + strlen(fn) - 1; - for (; cp >= fn; cp--) { - if (ep && (*cp == '/')) { - fn = ep; - break; - } - if (*cp == '/' || *cp == '~') - ep = cp; - else - ep = NULL; - } - /* first handle tilde expansion */ if (fn[0] == '~') { struct passwd *pw; |