X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/e4a7a2efc2737e64ac0cf42b148f06566718c1d7..199eda4478d4d90df3199670dc0ab51b4bb031a6:/tbl_opts.c?ds=inline diff --git a/tbl_opts.c b/tbl_opts.c index ae1df965..f2f5942a 100644 --- a/tbl_opts.c +++ b/tbl_opts.c @@ -1,4 +1,4 @@ -/* $Id: tbl_opts.c,v 1.18 2015/01/26 13:03:48 schwarze Exp $ */ +/* $Id: tbl_opts.c,v 1.21 2015/09/26 00:54:04 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2015 Ingo Schwarze @@ -80,7 +80,8 @@ arg(struct tbl_node *tbl, int ln, const char *p, int *pos, int key) switch (key) { case KEY_DELIM: - mandoc_msg(MANDOCERR_TBLEQN, tbl->parse, ln, *pos, NULL); + mandoc_vmsg(MANDOCERR_TBLOPT_EQN, tbl->parse, + ln, *pos, "%.*s", len, p + *pos); want = 2; break; case KEY_TAB: @@ -98,7 +99,6 @@ arg(struct tbl_node *tbl, int ln, const char *p, int *pos, int key) break; default: abort(); - /* NOTREACHED */ } if (len == 0) @@ -120,17 +120,19 @@ arg(struct tbl_node *tbl, int ln, const char *p, int *pos, int key) * and some options are followed by arguments. */ void -tbl_option(struct tbl_node *tbl, int ln, const char *p) +tbl_option(struct tbl_node *tbl, int ln, const char *p, int *offs) { int i, pos, len; - pos = 0; + pos = *offs; for (;;) { while (p[pos] == ' ' || p[pos] == '\t' || p[pos] == ',') pos++; - if (p[pos] == ';') + if (p[pos] == ';') { + *offs = pos + 1; return; + } /* Parse one option name. */