Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/man Be more permissive in interpreting man pages as ...



details:   https://anonhg.NetBSD.org/src/rev/ae5e37d5c129
branches:  trunk
changeset: 790408:ae5e37d5c129
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Oct 06 16:29:26 2013 +0000

description:
Be more permissive in interpreting man pages as filenames, from Franco
Fichter via dfly. fixes:
        $ man usr.bin/man/man.1

diffstat:

 usr.bin/man/man.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r 0ead322e28cf -r ae5e37d5c129 usr.bin/man/man.c
--- a/usr.bin/man/man.c Sun Oct 06 12:27:15 2013 +0000
+++ b/usr.bin/man/man.c Sun Oct 06 16:29:26 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: man.c,v 1.56 2013/07/30 15:10:04 joerg Exp $   */
+/*     $NetBSD: man.c,v 1.57 2013/10/06 16:29:26 christos Exp $        */
 
 /*
  * Copyright (c) 1987, 1993, 1994, 1995
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)man.c      8.17 (Berkeley) 1/31/95";
 #else
-__RCSID("$NetBSD: man.c,v 1.56 2013/07/30 15:10:04 joerg Exp $");
+__RCSID("$NetBSD: man.c,v 1.57 2013/10/06 16:29:26 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -536,10 +536,10 @@
        *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, '/') != NULL) {
                /* check if file actually exists */
                (void)strlcpy(buf, escpage, sizeof(buf));
                error = glob(buf, GLOB_APPEND | GLOB_BRACE | GLOB_NOSORT, NULL, pg);



Home | Main Index | Thread Index | Old Index