diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2021-06-27 17:57:54 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2021-06-27 17:57:54 +0000 |
commit | 2ec8a158cb2aaa80f61ebc3874b1650780239ef5 (patch) | |
tree | bc2f63eaafd788f966ab5f61236a0b8c3cf34a70 /read.c | |
parent | 5e803b18a3083fa5c78121999261879e3c89c0d9 (diff) | |
download | mandoc-2ec8a158cb2aaa80f61ebc3874b1650780239ef5.tar.gz |
add a style message about overlong text lines,
trying very hard to avoid false positives,
not at all trying to catch as many cases as possible;
feature originally suggested by tb@,
OK tb@ kn@ jmc@
Diffstat (limited to 'read.c')
-rw-r--r-- | read.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -154,6 +154,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 */ @@ -180,6 +181,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')) { @@ -279,7 +281,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. */ |