diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2011-12-12 02:00:49 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2011-12-12 02:00:49 +0000 |
commit | c42838fef393e5adf1aa518e01ad6d6a81fdacac (patch) | |
tree | 4159f03b7d7c3896b82b9ac86577327883c89771 /manpath.c | |
parent | 21233e404785a217f2bc0d3060f79f76911b9e1e (diff) | |
download | mandoc-c42838fef393e5adf1aa518e01ad6d6a81fdacac.tar.gz |
implement -C (alternative config file) for apropos(1) and mandocdb(8),
including various tweaks to the whatis(8) manual;
ok kristaps@
Diffstat (limited to 'manpath.c')
-rw-r--r-- | manpath.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -36,7 +36,8 @@ static void manpath_add(struct manpaths *, const char *); void -manpath_parse(struct manpaths *dirs, char *defp, char *auxp) +manpath_parse(struct manpaths *dirs, const char *file, + char *defp, char *auxp) { manpath_parseline(dirs, auxp); @@ -45,7 +46,7 @@ manpath_parse(struct manpaths *dirs, char *defp, char *auxp) defp = getenv("MANPATH"); if (NULL == defp) - manpath_parseconf(dirs); + manpath_parseconf(dirs, file); else manpath_parseline(dirs, defp); } @@ -91,7 +92,7 @@ manpath_add(struct manpaths *dirs, const char *dir) } void -manpath_parseconf(struct manpaths *dirs) +manpath_parseconf(struct manpaths *dirs, const char *file) { #ifdef USE_MANPATH FILE *stream; @@ -124,7 +125,7 @@ manpath_parseconf(struct manpaths *dirs) free(buf); pclose(stream); #else - manpath_manconf(MAN_CONF_FILE, dirs); + manpath_manconf(dirs, file ? file : MAN_CONF_FILE); #endif } @@ -140,7 +141,7 @@ manpath_free(struct manpaths *p) } void -manpath_manconf(const char *file, struct manpaths *dirs) +manpath_manconf(struct manpaths *dirs, const char *file) { FILE *stream; char *p, *q; |