diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2008-12-08 16:29:57 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2008-12-08 16:29:57 +0000 |
commit | 2cf6c3e0cc5c2b88c77c74a4b882f175a4ade7d1 (patch) | |
tree | 0bc61456c3c8d007ee0519f53e5e20dae79ffeb9 /libmdocml.c | |
parent | c450c948a71ae4f6bbc35141cfdc41d3ae0775ba (diff) | |
download | mandoc-2cf6c3e0cc5c2b88c77c74a4b882f175a4ade7d1.tar.gz |
*** empty log message ***
Diffstat (limited to 'libmdocml.c')
-rw-r--r-- | libmdocml.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/libmdocml.c b/libmdocml.c index ba4e850f..5dbc6364 100644 --- a/libmdocml.c +++ b/libmdocml.c @@ -28,8 +28,6 @@ #include "libmdocml.h" #include "private.h" -#define BUFFER_LINE BUFSIZ /* Default line-buffer size. */ - static int md_run_enter(const struct md_args *, struct md_mbuf *, struct md_rbuf *, void *); static int md_run_leave(const struct md_args *, struct md_mbuf *, @@ -162,8 +160,8 @@ md_run_enter(const struct md_args *args, struct md_mbuf *mbuf, struct md_rbuf *rbuf, void *p) { ssize_t sz, i; - char line[BUFFER_LINE]; size_t pos; + char line[MD_LINE]; md_line fp; assert(args); @@ -192,17 +190,10 @@ again: return(md_run_leave(args, mbuf, rbuf, 0, p)); for (i = 0; i < sz; i++) { - /* - if ( ! isascii(rbuf->buf[i])) { - warnx("%s: non-ascii char (line %zu, col %zu)", - rbuf->name, rbuf->line, pos); - return(md_run_leave(args, mbuf, rbuf, -1, p)); - } - */ if ('\n' != rbuf->buf[i]) { - if (pos < BUFFER_LINE) { + if (pos < MD_LINE) { /* LINTED */ - line[pos++] = rbuf->buf[i]; + rbuf->linebuf[pos++] = rbuf->buf[i]; continue; } warnx("%s: line %zu too long", @@ -210,7 +201,8 @@ again: return(md_run_leave(args, mbuf, rbuf, -1, p)); } - line[(int)pos] = 0; + rbuf->linebuf[(int)pos] = 0; + (void)memcpy(line, rbuf->linebuf, sizeof(line)); if ( ! (*fp)(p, line)) return(md_run_leave(args, mbuf, rbuf, -1, p)); rbuf->line++; |