=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/manpath.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- src/usr.bin/mandoc/manpath.c 2014/11/18 19:40:38 1.11 +++ src/usr.bin/mandoc/manpath.c 2015/03/21 17:18:17 1.12 @@ -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 + * Copyright (c) 2011, 2014, 2015 Ingo Schwarze * Copyright (c) 2011 Kristaps Dzonsons * * 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 @@ 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 @@ /* 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; }