summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorKjell Wooding <kjell@cvs.openbsd.org>2005-11-11 18:51:50 +0000
committerKjell Wooding <kjell@cvs.openbsd.org>2005-11-11 18:51:50 +0000
commitea77f7f2de9151dab49ca5704c70dc878e926183 (patch)
tree23326473160ca4d4841325fc2b28ea812756965f /usr.bin
parentbec4a2de49b78f5c5be53ea1f1b0cdce3865038c (diff)
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.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mg/fileio.c17
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;