=================================================================== RCS file: /cvs/mandoc/mandocdb.c,v retrieving revision 1.72 retrieving revision 1.74 diff -u -p -r1.72 -r1.74 --- mandoc/mandocdb.c 2013/10/18 21:10:07 1.72 +++ mandoc/mandocdb.c 2013/10/27 16:09:44 1.74 @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.72 2013/10/18 21:10:07 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.74 2013/10/27 16:09:44 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); @@ -1792,7 +1792,7 @@ dbindex(struct mchars *mc, int form, const struct of * return; desc = ""; - if (NULL != of->desc) { + if (NULL != of->desc && '\0' != *of->desc) { key = ohash_find(&strings, ohash_qlookup(&strings, of->desc)); assert(NULL != key);