=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/manpath.c,v retrieving revision 1.14 retrieving revision 1.15 diff -c -r1.14 -r1.15 *** src/usr.bin/mandoc/manpath.c 2015/03/27 17:36:56 1.14 --- src/usr.bin/mandoc/manpath.c 2015/05/07 12:07:29 1.15 *************** *** 1,4 **** ! /* $OpenBSD: manpath.c,v 1.14 2015/03/27 17:36:56 schwarze Exp $ */ /* * Copyright (c) 2011, 2014, 2015 Ingo Schwarze * Copyright (c) 2011 Kristaps Dzonsons --- 1,4 ---- ! /* $OpenBSD: manpath.c,v 1.15 2015/05/07 12:07:29 schwarze Exp $ */ /* * Copyright (c) 2011, 2014, 2015 Ingo Schwarze * Copyright (c) 2011 Kristaps Dzonsons *************** *** 39,45 **** manconf_parse(struct manconf *conf, const char *file, char *defp, char *auxp) { - char manpath_default[] = MANPATH_DEFAULT; char *insert; /* Always prepend -m. */ --- 39,44 ---- *************** *** 59,66 **** /* No MANPATH; use man.conf(5) only. */ if (NULL == defp || '\0' == defp[0]) { manconf_file(conf, file); - if (conf->manpath.sz == 0) - manpath_parseline(&conf->manpath, manpath_default, 0); return; } --- 58,63 ---- *************** *** 164,176 **** manconf_file(struct manconf *conf, const char *file) { const char *const toks[] = { "manpath", "output", "_whatdb" }; FILE *stream; char *cp, *ep; size_t len, tok; if ((stream = fopen(file, "r")) == NULL) ! return; while ((cp = fgetln(stream, &len)) != NULL) { ep = cp + len; --- 161,174 ---- manconf_file(struct manconf *conf, const char *file) { const char *const toks[] = { "manpath", "output", "_whatdb" }; + char manpath_default[] = MANPATH_DEFAULT; FILE *stream; char *cp, *ep; size_t len, tok; if ((stream = fopen(file, "r")) == NULL) ! goto out; while ((cp = fgetln(stream, &len)) != NULL) { ep = cp + len; *************** *** 204,209 **** --- 202,208 ---- /* FALLTHROUGH */ case 0: /* manpath */ manpath_add(&conf->manpath, cp, 0); + *manpath_default = '\0'; break; case 1: /* output */ manconf_output(&conf->output, cp); *************** *** 212,219 **** break; } } - fclose(stream); } void --- 211,221 ---- break; } } fclose(stream); + + out: + if (*manpath_default != '\0') + manpath_parseline(&conf->manpath, manpath_default, 0); } void