summaryrefslogtreecommitdiffstats
path: root/validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-11-30 12:41:45 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-11-30 12:41:45 +0000
commit8a90e3149d99de9d2b20d61307f7d4951ef18bf0 (patch)
tree19fb948aa6f2460eda81fca32587258e79dbc8af /validate.c
parent3719de929133a40fc04f78a150c51c878a2b8d2a (diff)
downloadmandoc-8a90e3149d99de9d2b20d61307f7d4951ef18bf0.tar.gz
Backed out PUNCT changes (again).
Diffstat (limited to 'validate.c')
-rw-r--r--validate.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/validate.c b/validate.c
index c4286928..e5ca3a50 100644
--- a/validate.c
+++ b/validate.c
@@ -94,9 +94,12 @@ mbuf_newline(struct md_valid *p)
static int
mbuf_data(struct md_valid *p, char *buf)
{
+ int space;
size_t sz;
char *bufp;
+ space = 1; /* FIXME */
+
assert(p->mbuf);
assert(0 != p->indent);
@@ -133,10 +136,7 @@ mbuf_data(struct md_valid *p, char *buf)
continue;
}
- if ( ! md_buf_putchar(p->mbuf, ' '))
- return(0);
-
- p->pos += sz + 1;
+ p->pos += sz;
continue;
}
@@ -145,14 +145,14 @@ mbuf_data(struct md_valid *p, char *buf)
return(0);
if ( ! mbuf_indent(p))
return(0);
- }
+ } else if (space)
+ if ( ! md_buf_putchar(p->mbuf, ' '))
+ return(0);
if ( ! md_buf_putstring(p->mbuf, bufp))
return(0);
- if ( ! md_buf_putchar(p->mbuf, ' '))
- return(0);
- p->pos += sz + 1;
+ p->pos += sz + (space ? 1 : 0);
}
return(1);
@@ -334,14 +334,14 @@ roffin(void *arg, int tok, int *argcp, char **argvp)
if (0 == p->pos && ! mbuf_indent(p))
return(0);
- if ( ! md_buf_putstring(p->mbuf, "<"))
+ if ( ! md_buf_putstring(p->mbuf, " <"))
return(0);
if ( ! md_buf_putstring(p->mbuf, toknames[tok]))
return(0);
if ( ! md_buf_putstring(p->mbuf, ">"))
return(0);
- p->pos += strlen(toknames[tok]) + 2;
+ p->pos += strlen(toknames[tok]) + 3;
return(1);
}
@@ -362,10 +362,10 @@ roffout(void *arg, int tok)
return(0);
if ( ! md_buf_putstring(p->mbuf, toknames[tok]))
return(0);
- if ( ! md_buf_putstring(p->mbuf, "> "))
+ if ( ! md_buf_putstring(p->mbuf, ">"))
return(0);
- p->pos += strlen(toknames[tok]) + 3;
+ p->pos += strlen(toknames[tok]) + 2;
return(1);
}