- switch (tbl_next(tbl, p, pos)) {
- case (TBL_TOK__MAX):
- break;
- case (TBL_TOK_SPACE):
- /* FALLTHROUGH */
- case (TBL_TOK_TAB):
- goto again;
- case (TBL_TOK_SEMICOLON):
- tbl->part = TBL_PART_LAYOUT;
- return(1);
- default:
- return(0);
+ while (isspace((unsigned char)p[*pos]))
+ (*pos)++;
+
+ /* Safe exit point. */
+
+ if (';' == p[*pos])
+ return;
+
+ /* Copy up to first non-alpha character. */
+
+ for (sv = *pos, i = 0; i < KEY_MAXNAME; i++, (*pos)++) {
+ buf[i] = (char)tolower((unsigned char)p[*pos]);
+ if ( ! isalpha((unsigned char)buf[i]))
+ break;
+ }
+
+ /* Exit if buffer is empty (or overrun). */
+
+ if (KEY_MAXNAME == i || 0 == i) {
+ mandoc_msg(MANDOCERR_TBL, tbl->parse, ln, *pos, NULL);
+ return;