=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/main.c,v retrieving revision 1.198 retrieving revision 1.199 diff -c -r1.198 -r1.199 *** src/usr.bin/mandoc/main.c 2017/07/01 12:00:12 1.198 --- src/usr.bin/mandoc/main.c 2017/07/01 12:53:56 1.199 *************** *** 1,4 **** ! /* $OpenBSD: main.c,v 1.198 2017/07/01 12:00:12 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: main.c,v 1.199 2017/07/01 12:53:56 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze *************** *** 633,646 **** if (globres == 0) file = mandoc_strdup(*globinfo.gl_pathv); globfree(&globinfo); ! if (globres != 0) return 0; found: warnx("outdated mandoc.db lacks %s(%s) entry, run makewhatis %s", name, sec, paths->paths[ipath]); ! if (res == NULL) return 1; *res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage)); page = *res + (*ressz - 1); page->file = file; --- 633,655 ---- if (globres == 0) file = mandoc_strdup(*globinfo.gl_pathv); globfree(&globinfo); ! if (globres == 0) ! goto found; ! if (res != NULL || ipath + 1 != paths->sz) return 0; + mandoc_asprintf(&file, "%s.%s", name, sec); + globres = access(file, R_OK); + free(file); + return globres != -1; + found: warnx("outdated mandoc.db lacks %s(%s) entry, run makewhatis %s", name, sec, paths->paths[ipath]); ! if (res == NULL) { ! free(file); return 1; + } *res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage)); page = *res + (*ressz - 1); page->file = file;