diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-09-07 02:17:40 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-09-07 02:17:40 +0000 |
commit | 7c52c557c239f14fe4680df3ac9e78fa295307a6 (patch) | |
tree | cb027d9edfab618962f8c336da966196b649248a | |
parent | e13eaef731c921e8230fb25465559ac5145a9500 (diff) | |
download | mandoc-7c52c557c239f14fe4680df3ac9e78fa295307a6.tar.gz |
always use the right buffer, and fix one evil typo
-rw-r--r-- | read.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -262,7 +262,7 @@ choose_parser(struct mparse *curp) cp = curp->primary->buf; ep = cp + curp->primary->sz; while (cp < ep) { - if (*cp == '.' || *cp != '\'') { + if (*cp == '.' || *cp == '\'') { cp++; if (cp[0] == 'D' && cp[1] == 'd') { format = MPARSE_MDOC; @@ -712,6 +712,7 @@ mparse_end(struct mparse *curp) static void mparse_parse_buffer(struct mparse *curp, struct buf blk, const char *file) { + struct buf *svprimary; const char *svfile; static int recursion_depth; @@ -723,6 +724,7 @@ mparse_parse_buffer(struct mparse *curp, struct buf blk, const char *file) /* Line number is per-file. */ svfile = curp->file; curp->file = file; + svprimary = curp->primary; curp->primary = &blk; curp->line = 1; recursion_depth++; @@ -732,6 +734,7 @@ mparse_parse_buffer(struct mparse *curp, struct buf blk, const char *file) if (0 == --recursion_depth && MANDOCLEVEL_FATAL > curp->file_status) mparse_end(curp); + curp->primary = svprimary; curp->file = svfile; } |