=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_validate.c,v retrieving revision 1.86 retrieving revision 1.87 diff -c -r1.86 -r1.87 *** src/usr.bin/mandoc/mdoc_validate.c 2011/01/30 17:41:59 1.86 --- src/usr.bin/mandoc/mdoc_validate.c 2011/01/30 18:28:01 1.87 *************** *** 1,4 **** ! /* $Id: mdoc_validate.c,v 1.86 2011/01/30 17:41:59 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: mdoc_validate.c,v 1.87 2011/01/30 18:28:01 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * *************** *** 90,95 **** --- 90,96 ---- static int post_bl_block_width(POST_ARGS); static int post_bl_block_tag(POST_ARGS); static int post_bl_head(POST_ARGS); + static int post_bx(POST_ARGS); static int post_dd(POST_ARGS); static int post_dt(POST_ARGS); static int post_defaults(POST_ARGS); *************** *** 129,134 **** --- 130,136 ---- static v_post posts_bf[] = { hwarn_le1, post_bf, NULL }; static v_post posts_bk[] = { hwarn_eq0, bwarn_ge1, NULL }; static v_post posts_bl[] = { bwarn_ge1, post_bl, NULL }; + static v_post posts_bx[] = { post_bx, NULL }; static v_post posts_bool[] = { ebool, NULL }; static v_post posts_eoln[] = { post_eoln, NULL }; static v_post posts_defaults[] = { post_defaults, NULL }; *************** *** 230,236 **** { NULL, NULL }, /* Bo */ { NULL, NULL }, /* Bq */ { NULL, NULL }, /* Bsx */ ! { NULL, NULL }, /* Bx */ { NULL, posts_bool }, /* Db */ { NULL, NULL }, /* Dc */ { NULL, NULL }, /* Do */ --- 232,238 ---- { NULL, NULL }, /* Bo */ { NULL, NULL }, /* Bq */ { NULL, NULL }, /* Bsx */ ! { NULL, posts_bx }, /* Bx */ { NULL, posts_bool }, /* Db */ { NULL, NULL }, /* Dc */ { NULL, NULL }, /* Do */ *************** *** 2090,2095 **** --- 2092,2115 ---- mdoc_node_delete(mdoc, mdoc->last); if (mdoc->meta.title && mdoc->meta.date && mdoc->meta.os) mdoc->flags |= MDOC_PBODY; + + return(1); + } + + static int + post_bx(POST_ARGS) + { + struct mdoc_node *n; + + /* + * Make `Bx's second argument always start with an uppercase + * letter. Groff checks if it's an "accepted" term, but we just + * uppercase blindly. + */ + + n = mdoc->last->child; + if (n && NULL != (n = n->next)) + *n->string = toupper((unsigned char)*n->string); return(1); }