Module Name:    src
Committed By:   christos
Date:           Sun Oct  6 16:29:26 UTC 2013

Modified Files:
        src/usr.bin/man: man.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/man/man.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/man/man.c
diff -u src/usr.bin/man/man.c:1.56 src/usr.bin/man/man.c:1.57
--- src/usr.bin/man/man.c:1.56	Tue Jul 30 11:10:04 2013
+++ src/usr.bin/man/man.c	Sun Oct  6 12:29:26 2013
@@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
 #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 @@ manual(char *page, struct manstate *mp, 
 	*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);

Reply via email to