From 89c23755c8ab5d8c5bbbfa6e40eb0c6bda109dad Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Wed, 14 Jul 2021 14:39:31 +0300 Subject: update CVS --- usr.bin/mandoc/read.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'usr.bin/mandoc/read.c') 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 * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons @@ -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. */ -- cgit v1.2.3