=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mandocdb.c,v retrieving revision 1.144 retrieving revision 1.145 diff -c -r1.144 -r1.145 *** src/usr.bin/mandoc/mandocdb.c 2015/04/18 16:04:40 1.144 --- src/usr.bin/mandoc/mandocdb.c 2015/04/18 16:34:03 1.145 *************** *** 1,4 **** ! /* $OpenBSD: mandocdb.c,v 1.144 2015/04/18 16:04:40 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011-2015 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: mandocdb.c,v 1.145 2015/04/18 16:34:03 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011-2015 Ingo Schwarze *************** *** 1089,1095 **** struct ohash_info str_info; struct mpage *mpage, *mpage_dest; struct mlink *mlink, *mlink_dest; - struct roff_man *mdoc; struct roff_man *man; char *sodest; char *cp; --- 1089,1094 ---- *************** *** 1117,1123 **** ohash_init(&names, 4, &str_info); ohash_init(&strings, 6, &str_info); mparse_reset(mp); - mdoc = NULL; man = NULL; sodest = NULL; --- 1116,1121 ---- *************** *** 1133,1139 **** */ if (mlink->dform != FORM_CAT || mlink->fform != FORM_CAT) { mparse_readfd(mp, fd, mlink->file); ! mparse_result(mp, &mdoc, &man, &sodest); } if (sodest != NULL) { --- 1131,1137 ---- */ if (mlink->dform != FORM_CAT || mlink->fform != FORM_CAT) { mparse_readfd(mp, fd, mlink->file); ! mparse_result(mp, &man, &sodest); } if (sodest != NULL) { *************** *** 1177,1193 **** mpage->mlinks = NULL; } goto nextpage; ! } else if (mdoc != NULL) { mpage->form = FORM_SRC; ! mpage->sec = mdoc_meta(mdoc)->msec; mpage->sec = mandoc_strdup( mpage->sec == NULL ? "" : mpage->sec); ! mpage->arch = mdoc_meta(mdoc)->arch; mpage->arch = mandoc_strdup( mpage->arch == NULL ? "" : mpage->arch); mpage->title = ! mandoc_strdup(mdoc_meta(mdoc)->title); ! } else if (man != NULL) { mpage->form = FORM_SRC; mpage->sec = mandoc_strdup(man_meta(man)->msec); mpage->arch = mandoc_strdup(mlink->arch); --- 1175,1191 ---- mpage->mlinks = NULL; } goto nextpage; ! } else if (man != NULL && man->macroset == MACROSET_MDOC) { mpage->form = FORM_SRC; ! mpage->sec = mdoc_meta(man)->msec; mpage->sec = mandoc_strdup( mpage->sec == NULL ? "" : mpage->sec); ! mpage->arch = mdoc_meta(man)->arch; mpage->arch = mandoc_strdup( mpage->arch == NULL ? "" : mpage->arch); mpage->title = ! mandoc_strdup(mdoc_meta(man)->title); ! } else if (man != NULL && man->macroset == MACROSET_MAN) { mpage->form = FORM_SRC; mpage->sec = mandoc_strdup(man_meta(man)->msec); mpage->arch = mandoc_strdup(mlink->arch); *************** *** 1213,1220 **** } assert(mpage->desc == NULL); ! if (mdoc != NULL) ! parse_mdoc(mpage, mdoc_meta(mdoc), mdoc_node(mdoc)); else if (man != NULL) parse_man(mpage, man_meta(man), man_node(man)); else --- 1211,1218 ---- } assert(mpage->desc == NULL); ! if (man != NULL && man->macroset == MACROSET_MDOC) ! parse_mdoc(mpage, mdoc_meta(man), mdoc_node(man)); else if (man != NULL) parse_man(mpage, man_meta(man), man_node(man)); else