summaryrefslogtreecommitdiffstats
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
commita230269a41845b9f72616b3c61dc910ab46e7d1a (patch)
tree840601550d8d01471a010c8a840e7dff2e164703
parent4a384ead2acef7f2ea8e57f9ee5b8b62b6852181 (diff)
downloadmandoc-a230269a41845b9f72616b3c61dc910ab46e7d1a.tar.gz
More cleanups for TABSEP handling.
-rw-r--r--mdoc_argv.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mdoc_argv.c b/mdoc_argv.c
index 8a3b46c1..56680fad 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -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. */ ;