NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/59625
The following reply was made to PR bin/59625; it has been noted by GNATS.
From: Ingo Schwarze <schwarze%usta.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: schwarze%openbsd.org@localhost
Subject: Re: bin/59625
Date: Tue, 2 Sep 2025 16:20:59 +0200
Index: man.1
===================================================================
RCS file: /cvsroot/src/usr.bin/man/man.1,v
retrieving revision 1.31
diff -u -p -r1.31 man.1
--- man.1 29 Nov 2024 07:55:10 -0000 1.31
+++ man.1 2 Sep 2025 13:41:34 -0000
@@ -38,7 +38,7 @@
.Pq aka Dq Em man pages
.Sh SYNOPSIS
.Nm
-.Oo Fl acw Ns \&| Ns Fl h Oc
+.Oo Fl aclw Ns \&| Ns Fl h Oc
.Op Fl C Ar file
.Op Fl M Ar path
.Op Fl m Ar path
@@ -102,6 +102,15 @@ Search man pages for
.Ar keyword Ns Pq s ,
in the same manner as
.Xr apropos 1 .
+.It Fl l
+Interpret all arguments as absolute or relative filenames
+of the manual page files to display.
+No search is done and the options
+.Fl M ,
+.Fl m ,
+and
+.Fl S
+are ignored.
.It Fl M Ar path
Override the list of standard directories which
.Nm
Index: man.c
===================================================================
RCS file: /cvsroot/src/usr.bin/man/man.c,v
retrieving revision 1.73
diff -u -p -r1.73 man.c
--- man.c 10 May 2022 00:42:00 -0000 1.73
+++ man.c 2 Sep 2025 13:41:34 -0000
@@ -84,6 +84,7 @@ struct manstate {
int cat; /* -c: do not use a pager */
char *conffile; /* -C: use alternate config file */
int how; /* -h: show SYNOPSIS only */
+ int local; /* -l: interpret arguments as filenames */
char *manpath; /* -M: alternate MANPATH */
char *addpath; /* -m: add these dirs to front of manpath */
char *pathsearch; /* -S: path of man must contain this string */
@@ -146,7 +147,7 @@ main(int argc, char **argv)
/*
* parse command line...
*/
- while ((ch = getopt(argc, argv, "-aC:cfhkM:m:P:ps:S:w")) != -1)
+ while ((ch = getopt(argc, argv, "-aC:cfhklM:m:P:ps:S:w")) != -1)
switch (ch) {
case 'a':
m.all = 1;
@@ -161,6 +162,9 @@ main(int argc, char **argv)
case 'h':
m.how = 1;
break;
+ case 'l':
+ m.local = 1;
+ break;
case 'm':
m.addpath = optarg;
break;
@@ -585,7 +589,8 @@ manual(char *page, struct manstate *mp,
* or a relative path explicitly beginning with "./"
* or "../", then interpret it as a file specification.
*/
- if ((page[0] == '/')
+ if (mp->local
+ || (page[0] == '/')
|| (page[0] == '.' && page[1] == '/')
|| (page[0] == '.' && page[1] == '.' && page[2] == '/')
) {
Home |
Main Index |
Thread Index |
Old Index