X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/94a9d688b92e28a5ccd562894a0046846845290d..68a4884e51e55098303cfe5b920959d493ee8e73:/mdoc_argv.c

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. */ ;