From 8a90e3149d99de9d2b20d61307f7d4951ef18bf0 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 30 Nov 2008 12:41:45 +0000 Subject: Backed out PUNCT changes (again). --- validate.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'validate.c') 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); } -- cgit