From: Franco Fichtner Date: Sat, 5 Oct 2013 16:01:07 +0000 (+0200) Subject: man(1): tweak literal file interpretation X-Git-Tag: v3.7.0~224 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/5b129c2febb49a4ed04f330b78d9f5f73ca6de7c man(1): tweak literal file interpretation The previous behaviour would not catch the following invoke: # man usr.bin/man/man.1 Now, as a generalised rule, the literal interpretation is triggered by any '/' character in the requested page(s). --- diff --git a/usr.bin/man/man.c b/usr.bin/man/man.c index 7e5343c565..2bec0d4347 100644 --- a/usr.bin/man/man.c +++ b/usr.bin/man/man.c @@ -536,10 +536,10 @@ manual(char *page, struct manstate *mp, glob_t *pg) *eptr = '\0'; /* - * If 'page' is given with a full or relative path - * then interpret it as a file specification. + * If 'page' contains a slash then it's + * interpreted as a file specification. */ - if ((page[0] == '/') || (page[0] == '.')) { + if (strchr(page, '/')) { /* check if file actually exists */ (void)strlcpy(buf, escpage, sizeof(buf)); error = glob(buf, GLOB_APPEND | GLOB_BRACE | GLOB_NOSORT, NULL, pg);