diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2008-11-30 12:41:45 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2008-11-30 12:41:45 +0000 |
commit | 8a90e3149d99de9d2b20d61307f7d4951ef18bf0 (patch) | |
tree | 19fb948aa6f2460eda81fca32587258e79dbc8af /validate.c | |
parent | 3719de929133a40fc04f78a150c51c878a2b8d2a (diff) | |
download | mandoc-8a90e3149d99de9d2b20d61307f7d4951ef18bf0.tar.gz |
Backed out PUNCT changes (again).
Diffstat (limited to 'validate.c')
-rw-r--r-- | validate.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -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); } |