aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/read.c
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2021-07-14 14:39:31 +0300
committerCem Keylan <cem@ckyln.com>2021-07-14 14:39:31 +0300
commit89c23755c8ab5d8c5bbbfa6e40eb0c6bda109dad (patch)
tree0619d977ce4ceecca0523f20a0609a293440e030 /usr.bin/mandoc/read.c
parent0ea3661a6ba0baaa39b95e836e8f2c87e2f4c20f (diff)
downloadotools-89c23755c8ab5d8c5bbbfa6e40eb0c6bda109dad.tar.gz
update CVS
Diffstat (limited to 'usr.bin/mandoc/read.c')
-rw-r--r--usr.bin/mandoc/read.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c
index a6a25de..223dc82 100644
--- a/usr.bin/mandoc/read.c
+++ b/usr.bin/mandoc/read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read.c,v 1.190 2020/04/24 11:58:02 schwarze Exp $ */
+/* $OpenBSD: read.c,v 1.191 2021/06/27 17:57:13 schwarze Exp $ */
/*
* Copyright (c) 2010-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -152,6 +152,7 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start)
struct buf *firstln, *lastln, *thisln, *loop;
char *cp;
size_t pos; /* byte number in the ln buffer */
+ size_t spos; /* at the start of the current line parse */
int line_result, result;
int of;
int lnn; /* line number in the real file */
@@ -178,6 +179,7 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start)
curp->filenc & MPARSE_LATIN1)
curp->filenc = preconv_cue(&blk, i);
}
+ spos = pos;
while (i < blk.sz && (start || blk.buf[i] != '\0')) {
@@ -277,7 +279,8 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start)
of = 0;
rerun:
- line_result = roff_parseln(curp->roff, curp->line, &ln, &of);
+ line_result = roff_parseln(curp->roff, curp->line,
+ &ln, &of, start && spos == 0 ? pos : 0);
/* Process options. */