=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_validate.c,v retrieving revision 1.165 retrieving revision 1.166 diff -c -r1.165 -r1.166 *** src/usr.bin/mandoc/mdoc_validate.c 2014/09/11 23:52:47 1.165 --- src/usr.bin/mandoc/mdoc_validate.c 2014/09/12 00:53:21 1.166 *************** *** 1,4 **** ! /* $OpenBSD: mdoc_validate.c,v 1.165 2014/09/11 23:52:47 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: mdoc_validate.c,v 1.166 2014/09/12 00:53:21 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze *************** *** 99,104 **** --- 99,105 ---- static int post_es(POST_ARGS); static int post_eoln(POST_ARGS); static int post_ex(POST_ARGS); + static int post_fa(POST_ARGS); static int post_fo(POST_ARGS); static int post_hyph(POST_ARGS); static int post_hyphtext(POST_ARGS); *************** *** 156,165 **** { NULL, NULL }, /* Er */ { NULL, NULL }, /* Ev */ { pre_std, post_ex }, /* Ex */ ! { NULL, NULL }, /* Fa */ { NULL, ewarn_ge1 }, /* Fd */ { NULL, NULL }, /* Fl */ ! { NULL, NULL }, /* Fn */ { NULL, NULL }, /* Ft */ { NULL, NULL }, /* Ic */ { NULL, ewarn_eq1 }, /* In */ --- 157,166 ---- { NULL, NULL }, /* Er */ { NULL, NULL }, /* Ev */ { pre_std, post_ex }, /* Ex */ ! { NULL, post_fa }, /* Fa */ { NULL, ewarn_ge1 }, /* Fd */ { NULL, NULL }, /* Fl */ ! { NULL, post_fa }, /* Fn */ { NULL, NULL }, /* Ft */ { NULL, NULL }, /* Ic */ { NULL, ewarn_eq1 }, /* In */ *************** *** 1003,1008 **** --- 1004,1031 ---- hwarn_eq1(mdoc); bwarn_ge1(mdoc); + return(1); + } + + static int + post_fa(POST_ARGS) + { + const struct mdoc_node *n; + const char *cp; + + for (n = mdoc->last->child; n != NULL; n = n->next) { + for (cp = n->string; *cp != '\0'; cp++) { + /* Ignore callbacks and alterations. */ + if (*cp == '(' || *cp == '{') + break; + if (*cp != ',') + continue; + mandoc_msg(MANDOCERR_FA_COMMA, mdoc->parse, + n->line, n->pos + (cp - n->string), + n->string); + break; + } + } return(1); }