summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-07-20 14:12:27 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-07-20 14:12:27 +0000
commit205c0b3a2b64d0bd6f19e970acc354cc0851cd72 (patch)
tree1b5eb4bacc3eac9ee201339abc72ac80ef4609cd
parent94a9d688b92e28a5ccd562894a0046846845290d (diff)
downloadmandoc-205c0b3a2b64d0bd6f19e970acc354cc0851cd72.tar.gz
mandoc-205c0b3a2b64d0bd6f19e970acc354cc0851cd72.tar.zst
mandoc-205c0b3a2b64d0bd6f19e970acc354cc0851cd72.zip
More cleanups for TABSEP handling.
-rw-r--r--mdoc_argv.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mdoc_argv.c b/mdoc_argv.c
index 5e6865fc..1fe0017e 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_argv.c,v 1.20 2009/07/20 14:09:38 kristaps Exp $ */
+/* $Id: mdoc_argv.c,v 1.21 2009/07/20 14:12:27 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -376,7 +376,7 @@ static int
args(struct mdoc *m, int line, int *pos,
char *buf, int fl, char **v)
{
- int i, psv;
+ int i;
char *p, *pp;
assert(*pos);
@@ -421,8 +421,6 @@ args(struct mdoc *m, int line, int *pos,
*/
if (ARGS_TABSEP & fl) {
- psv = *pos;
-
/* Scan ahead to tab (can't be escaped). */
p = strchr(*v, '\t');
@@ -436,6 +434,10 @@ args(struct mdoc *m, int line, int *pos,
break;
}
+ /*
+ * Adjust new-buffer position to be beyond delimiter
+ * mark (e.g., Ta -> end + 2).
+ */
if (p && pp) {
*pos += pp < p ? 2 : 1;
p = pp < p ? pp : p;
@@ -447,15 +449,14 @@ args(struct mdoc *m, int line, int *pos,
} else
p = strchr(*v, 0);
+ /* Whitespace check for eoln case... */
if (0 == *p && ' ' == *(p - 1))
if ( ! mdoc_pwarn(m, line, *pos, ETAILWS))
return(ARGS_ERROR);
- *p = 0;
*pos += (int)(p - *v);
/* Strip delimiter's preceding whitespace. */
-
pp = p - 1;
while (pp > *v && ' ' == *pp) {
if (pp > *v && '\\' == *(pp - 1))
@@ -465,7 +466,6 @@ args(struct mdoc *m, int line, int *pos,
*(pp + 1) = 0;
/* Strip delimiter's proceeding whitespace. */
-
for (pp = &buf[*pos]; ' ' == *pp; pp++, (*pos)++)
/* Skip ahead. */ ;