X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/3cd681acae540f380510bee14cd2ef802fbf4706..1880ea9eb39746b72959a2f1863ec8c9dfa566a1:/argv.c diff --git a/argv.c b/argv.c index a49c5146..413f5dee 100644 --- a/argv.c +++ b/argv.c @@ -1,4 +1,4 @@ -/* $Id: argv.c,v 1.33 2009/02/27 09:39:40 kristaps Exp $ */ +/* $Id: argv.c,v 1.35 2009/03/03 22:28:21 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -251,11 +251,19 @@ mdoc_args(struct mdoc *mdoc, int line, /* LINTED */ for (i = 0; i < c; i++) { - if (MDOC_Column != n->data.block.argv[i].arg) - continue; - fl |= ARGS_TABSEP; - fl &= ~ARGS_DELIM; - break; + switch (n->data.block.argv[i].arg) { + case (MDOC_Column): + fl |= ARGS_TABSEP; + fl &= ~ARGS_DELIM; + i = c; + break; + case (MDOC_Diag): + fl |= ARGS_QUOTED; + i = c; + break; + default: + break; + } } } @@ -294,6 +302,10 @@ args(struct mdoc *mdoc, int line, if ( ! mdoc_iscdelim(buf[i])) break; i++; + /* There must be at least one space... */ + if (0 == buf[i] || ! isspace((int)buf[i])) + break; + i++; while (buf[i] && isspace((int)buf[i])) i++; }