X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/29086c29fdd989b9c086bf25e0790ba21243c4ff..9f11efb0307eb4c4dbb4a8fff243321100e27573:/mdoc_argv.c diff --git a/mdoc_argv.c b/mdoc_argv.c index 8f973e21..96ccef17 100644 --- a/mdoc_argv.c +++ b/mdoc_argv.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_argv.c,v 1.43 2010/05/08 07:30:19 kristaps Exp $ */ +/* $Id: mdoc_argv.c,v 1.45 2010/05/09 21:06:50 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -402,9 +402,10 @@ args(struct mdoc *m, int line, int *pos, return(ARGS_EOLN); /* - * If the first character is a delimiter and we're to look for - * delimited strings, then pass down the buffer seeing if it - * follows the pattern of [[::delim::][ ]+]+. + * If the first character is a closing delimiter and we're to + * look for delimited strings, then pass down the buffer seeing + * if it follows the pattern of [[::delim::][ ]+]+. Note that + * we ONLY care about closing delimiters. */ if ((fl & ARGS_DELIM) && mdoc_iscdelim(buf[*pos]) > 1) { @@ -412,14 +413,14 @@ args(struct mdoc *m, int line, int *pos, if ( mdoc_iscdelim(buf[i]) < 2) break; i++; - if (0 == buf[i] || ' ' != buf[i]) + if ('\0' == buf[i] || ' ' != buf[i]) break; i++; while (buf[i] && ' ' == buf[i]) i++; } - if (0 == buf[i]) { + if ('\0' == buf[i]) { *v = &buf[*pos]; if (' ' != buf[i - 1]) return(ARGS_PUNCT); @@ -471,8 +472,10 @@ args(struct mdoc *m, int line, int *pos, } else if (pp && ! p) { p = pp; *pos += 2; - } else + } else { + rc = ARGS_PEND; p = strchr(*v, 0); + } /* Whitespace check for eoln case... */ if (0 == *p && ' ' == *(p - 1) && ! (ARGS_NOWARN & fl))