=================================================================== RCS file: /cvs/mandoc/mandocdb.c,v retrieving revision 1.39 retrieving revision 1.41 diff -u -p -r1.39 -r1.41 --- mandoc/mandocdb.c 2011/12/25 14:58:39 1.39 +++ mandoc/mandocdb.c 2011/12/25 19:31:25 1.41 @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.39 2011/12/25 14:58:39 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.41 2011/12/25 19:31:25 kristaps Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2011 Ingo Schwarze @@ -1452,7 +1452,8 @@ static void ofile_argbuild(int argc, char *argv[], struct of **of) { char buf[MAXPATHLEN]; - char *sec, *arch, *title, *p; + const char *sec, *arch, *title; + char *p; int i, src_form; struct of *nof; @@ -1538,7 +1539,7 @@ ofile_argbuild(int argc, char *argv[], struct of **of) * Recursively build up a list of files to parse. * We use this instead of ftw() and so on because I don't want global * variables hanging around. - * This ignores the mandoc.db and mandoc.index files, but assumes that + * This ignores the whatis.db and whatis.index files, but assumes that * everything else is a manual. * Pass in a pointer to a NULL structure for the first invocation. */ @@ -1756,6 +1757,7 @@ ofile_dirbuild(const char *dir, const char* psec, cons if (verb > 1) printf("%s: scheduling\n", buf); + if (NULL == *of) { *of = nof; (*of)->first = nof; @@ -1774,7 +1776,10 @@ ofile_free(struct of *of) { struct of *nof; - while (of) { + if (NULL != of) + of = of->first; + + while (NULL != of) { nof = of->next; free(of->fname); free(of->sec);