* Support MANPATH as an alias for manpath
@ 2015-04-02 22:25 Baptiste Daroussin
0 siblings, 0 replies; only message in thread
From: Baptiste Daroussin @ 2015-04-02 22:25 UTC (permalink / raw)
To: tech
[-- Attachment #1.1: Type: text/plain, Size: 322 bytes --]
Hi,
I would like to minimize the modifications for FreeBSD when I will replace our
home made man(1) command to the mandoc one.
There is at least 2 thing I do want to keep:
MANPATH and MANCONFIG (I can skip MANLOCALE given I don't see a real usage for
it :))
Here is a first patch to support MANPATH
Best regards,
Bapt
[-- Attachment #1.2: support-MANPATH.diff --]
[-- Type: text/x-diff, Size: 1721 bytes --]
? :!
? ChangeLog
? Makefile.local
? config.h
? config.log
? demandoc
? makewhatis
? mandoc
? plop
? read.c.diff
? support-MANPATH.diff
Index: man.conf.5
===================================================================
RCS file: /cvs/mdocml/man.conf.5,v
retrieving revision 1.3
diff -u -r1.3 man.conf.5
--- man.conf.5 27 Mar 2015 21:33:20 -0000 1.3
+++ man.conf.5 2 Apr 2015 22:21:05 -0000
@@ -102,6 +102,9 @@
but using a historic and misleading syntax.
It is kept for backward compatibility for now,
but will eventually be removed.
+.It Ic MANPATH Ar path
+This directive provides the same finctionality as
+.Ic manpath .
.El
.Sh FILES
.Pa /etc/man.conf
Index: manpath.c
===================================================================
RCS file: /cvs/mdocml/manpath.c,v
retrieving revision 1.23
diff -u -r1.23 manpath.c
--- manpath.c 27 Mar 2015 17:37:25 -0000 1.23
+++ manpath.c 2 Apr 2015 22:21:05 -0000
@@ -209,7 +209,9 @@
static void
manconf_file(struct manconf *conf, const char *file)
{
- const char *const toks[] = { "manpath", "output", "_whatdb" };
+ const char *const toks[] = {
+ "MANPATH", "manpath", "output", "_whatdb"
+ };
FILE *stream;
char *cp, *ep;
@@ -241,17 +243,18 @@
}
switch (tok) {
- case 2: /* _whatdb */
+ case 3: /* _whatdb */
while (ep > cp && ep[-1] != '/')
ep--;
if (ep == cp)
continue;
*ep = '\0';
/* FALLTHROUGH */
- case 0: /* manpath */
+ case 1: /* manpath */
+ case 0: /* MANPATH */
manpath_add(&conf->manpath, cp, 0);
break;
- case 1: /* output */
+ case 2: /* output */
manconf_output(&conf->output, cp);
break;
default:
[-- Attachment #2: Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-04-02 22:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02 22:25 Support MANPATH as an alias for manpath Baptiste Daroussin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).