=================================================================== RCS file: /cvs/mandoc/mandocdb.c,v retrieving revision 1.73 retrieving revision 1.75 diff -u -p -r1.73 -r1.75 --- mandoc/mandocdb.c 2013/10/18 23:07:23 1.73 +++ mandoc/mandocdb.c 2013/10/27 16:41:31 1.75 @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.73 2013/10/18 23:07:23 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.75 2013/10/27 16:41:31 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013 Ingo Schwarze @@ -836,13 +836,13 @@ ofadd(int dform, const char *file, const char *name, c if (NULL == arch) arch = ""; - sform = FORM_NONE; - if (NULL != sec && *sec <= '9' && *sec >= '1') - sform = FORM_SRC; - else if (NULL != sec && *sec == '0') { + if ('0' == *sec) { sec = dsec; sform = FORM_CAT; - } + } else if ('1' <= *sec && '9' >= *sec) + sform = FORM_SRC; + else + sform = FORM_NONE; of = mandoc_calloc(1, sizeof(struct of)); strlcpy(of->file, file, PATH_MAX); @@ -961,7 +961,7 @@ ofmerge(struct mchars *mc, struct mparse *mp, int chec * source code, unless it is already known to be * formatted. Fall back to formatted mode. */ - if (FORM_SRC == of->dform || FORM_SRC == of->sform) { + if (FORM_CAT != of->dform || FORM_CAT != of->sform) { lvl = mparse_readfd(mp, -1, of->file); if (lvl < MANDOCLEVEL_FATAL) mparse_result(mp, &mdoc, &man);