Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/usr.bin/man Pull up following revision(s) (requested by m...
details: https://anonhg.NetBSD.org/src/rev/d6532bcca87d
branches: netbsd-7
changeset: 799744:d6532bcca87d
user: snj <snj%NetBSD.org@localhost>
date: Tue Jan 05 22:18:27 2016 +0000
description:
Pull up following revision(s) (requested by mlelstv in ticket #1057):
usr.bin/man/man.c: revision 1.62
For an argument to be interpreted as a local file name, bypassing the
search rules in man.conf or MANPATH, it must begin with "/", "./", or
"../". Simply testing whether it contains "/" is wrong, because it
breaks usage like "man 8 vax/boot".
This reverts revision 1.57 dated 2013-10-06,
"Be more permissive in interpreting man pages as filenames".
diffstat:
usr.bin/man/man.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diffs (36 lines):
diff -r 39f2927802f8 -r d6532bcca87d usr.bin/man/man.c
--- a/usr.bin/man/man.c Tue Jan 05 22:16:44 2016 +0000
+++ b/usr.bin/man/man.c Tue Jan 05 22:18:27 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: man.c,v 1.61 2014/02/17 03:10:12 uwe Exp $ */
+/* $NetBSD: man.c,v 1.61.4.1 2016/01/05 22:18:27 snj 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.61 2014/02/17 03:10:12 uwe Exp $");
+__RCSID("$NetBSD: man.c,v 1.61.4.1 2016/01/05 22:18:27 snj Exp $");
#endif
#endif /* not lint */
@@ -574,10 +574,14 @@
*eptr = '\0';
/*
- * If 'page' contains a slash then it's
- * interpreted as a file specification.
+ * If 'page' is given with an absolute path,
+ * or a relative path explicitly beginning with "./"
+ * or "../", then interpret it as a file specification.
*/
- if (strchr(page, '/') != NULL) {
+ if ((page[0] == '/')
+ || (page[0] == '.' && page[1] == '/')
+ || (page[0] == '.' && page[1] == '.' && page[2] == '/')
+ ) {
/* 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