diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-03-21 17:18:18 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-03-21 17:18:18 +0000 |
commit | e53edc3a7e105bd75ddce8423167417b6294c2ae (patch) | |
tree | 1888171953bbd878789fd514d0dcbad90d12494e /usr.bin/mandoc | |
parent | 2d4a247afecf46802a907ecf9091f0d160e0651f (diff) |
when there is no -m, no -M, no MANPATH and no /etc/man.conf,
fall back to /usr/share/man:/usr/X11R6/man:/usr/local/man
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/manpath.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/mandoc/manpath.c b/usr.bin/mandoc/manpath.c index 515ed67b820..fd07821708e 100644 --- a/usr.bin/mandoc/manpath.c +++ b/usr.bin/mandoc/manpath.c @@ -1,6 +1,6 @@ -/* $OpenBSD: manpath.c,v 1.11 2014/11/18 19:40:38 schwarze Exp $ */ +/* $OpenBSD: manpath.c,v 1.12 2015/03/21 17:18:17 schwarze Exp $ */ /* - * Copyright (c) 2011, 2014 Ingo Schwarze <schwarze@openbsd.org> + * Copyright (c) 2011, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any @@ -30,6 +30,7 @@ #define MAN_CONF_FILE "/etc/man.conf" #define MAN_CONF_KEY "_whatdb" +#define MANPATH_DEFAULT "/usr/share/man:/usr/X11R6/man:/usr/local/man" static void manpath_add(struct manpaths *, const char *, int); static void manpath_parseline(struct manpaths *, char *, int); @@ -38,6 +39,7 @@ void manpath_parse(struct manpaths *dirs, const char *file, char *defp, char *auxp) { + char manpath_default[] = MANPATH_DEFAULT; char *insert; /* Always prepend -m. */ @@ -57,6 +59,8 @@ manpath_parse(struct manpaths *dirs, const char *file, /* No MANPATH; use man.conf(5) only. */ if (NULL == defp || '\0' == defp[0]) { manpath_manconf(dirs, file); + if (dirs->sz == 0) + manpath_parseline(dirs, manpath_default, 0); return; } |