=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mandocdb.c,v retrieving revision 1.87 retrieving revision 1.88 diff -c -r1.87 -r1.88 *** src/usr.bin/mandoc/mandocdb.c 2014/04/04 16:43:08 1.87 --- src/usr.bin/mandoc/mandocdb.c 2014/04/04 18:23:07 1.88 *************** *** 1,4 **** ! /* $Id: mandocdb.c,v 1.87 2014/04/04 16:43:08 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze --- 1,4 ---- ! /* $Id: mandocdb.c,v 1.88 2014/04/04 18:23:07 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze *************** *** 139,145 **** static void hash_free(void *, size_t, void *); static void *hash_halloc(size_t, void *); static void mlink_add(struct mlink *, const struct stat *); ! static int mlink_check(struct mpage *, struct mlink *); static void mlink_free(struct mlink *); static void mlinks_undupe(struct mpage *); static void mpages_free(void); --- 139,145 ---- static void hash_free(void *, size_t, void *); static void *hash_halloc(size_t, void *); static void mlink_add(struct mlink *, const struct stat *); ! static void mlink_check(struct mpage *, struct mlink *); static void mlink_free(struct mlink *); static void mlinks_undupe(struct mpage *); static void mpages_free(void); *************** *** 916,928 **** } } ! static int mlink_check(struct mpage *mpage, struct mlink *mlink) { ! int match; - match = 1; - /* * Check whether the manual section given in a file * agrees with the directory where the file is located. --- 916,927 ---- } } ! static void mlink_check(struct mpage *mpage, struct mlink *mlink) { ! struct str *str; ! unsigned int slot; /* * Check whether the manual section given in a file * agrees with the directory where the file is located. *************** *** 933,943 **** */ if (FORM_SRC == mpage->form && ! strcasecmp(mpage->sec, mlink->dsec)) { ! match = 0; say(mlink->file, "Section \"%s\" manual in %s directory", mpage->sec, mlink->dsec); - } /* * Manual page directories exist for each kernel --- 932,940 ---- */ if (FORM_SRC == mpage->form && ! strcasecmp(mpage->sec, mlink->dsec)) say(mlink->file, "Section \"%s\" manual in %s directory", mpage->sec, mlink->dsec); /* * Manual page directories exist for each kernel *************** *** 952,967 **** * on amd64, i386, sparc, and sparc64. */ ! if (strcasecmp(mpage->arch, mlink->arch)) { ! match = 0; say(mlink->file, "Architecture \"%s\" manual in " "\"%s\" directory", mpage->arch, mlink->arch); - } ! if (strcasecmp(mpage->title, mlink->name)) ! match = 0; ! return(match); } /* --- 949,976 ---- * on amd64, i386, sparc, and sparc64. */ ! if (strcasecmp(mpage->arch, mlink->arch)) say(mlink->file, "Architecture \"%s\" manual in " "\"%s\" directory", mpage->arch, mlink->arch); ! /* ! * XXX ! * parse_cat() doesn't set TYPE_Nm and TYPE_NAME yet. ! */ ! if (FORM_CAT == mpage->form) ! return; ! ! /* ! * Check whether this mlink ! * appears as a name in the NAME section. ! */ ! ! slot = ohash_qlookup(&strings, mlink->name); ! str = ohash_find(&strings, slot); ! assert(NULL != str); ! if ( ! (TYPE_NAME & str->mask)) ! say(mlink->file, "Name missing in NAME section"); } /* *************** *** 984,990 **** char *sodest; char *cp; pid_t child_pid; ! int match, status; unsigned int pslot; enum mandoclevel lvl; --- 993,999 ---- char *sodest; char *cp; pid_t child_pid; ! int status; unsigned int pslot; enum mandoclevel lvl; *************** *** 1132,1146 **** putkey(mpage, mlink->name, TYPE_Nm); } - if (warnings && !use_all) { - match = 0; - for (mlink = mpage->mlinks; mlink; - mlink = mlink->next) - if (mlink_check(mpage, mlink)) - match = 1; - } else - match = 1; - if (NULL != mdoc) { if (NULL != (cp = mdoc_meta(mdoc)->name)) putkey(mpage, cp, TYPE_Nm); --- 1141,1146 ---- *************** *** 1152,1157 **** --- 1152,1162 ---- parse_man(mpage, man_node(man)); else parse_cat(mpage, fd[0]); + + if (warnings && !use_all) + for (mlink = mpage->mlinks; mlink; + mlink = mlink->next) + mlink_check(mpage, mlink); dbadd(mpage, mc);