summaryrefslogtreecommitdiffstats
path: root/mdoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-07 20:30:40 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-07 20:30:40 +0000
commit4c98151b506dab24c773ccfb5eb5d34f3ede915d (patch)
tree45c0ba3d2595578c94f77b0979b8d93d2c1c35bb /mdoc.c
parent38e5c73900c5e957ce2d1e4eec4c1222509aac9a (diff)
downloadmandoc-4c98151b506dab24c773ccfb5eb5d34f3ede915d.tar.gz
Make "new sentence, new line" detection stricter:
Also catch cases where the new sentence starts with a one-letter word and the input line is broken right after that word. Suggested by Thomas Klausner <wiz @ NetBSD>. It's merely a three-bit diff, changing one byte from 0x34 to 0x33, so what can possibly go wrong...
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mdoc.c b/mdoc.c
index 3bdec3db..23a661be 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -278,7 +278,7 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs)
for (c = buf + offs; c != NULL; c = strchr(c + 1, '.')) {
if (c - buf < offs + 2)
continue;
- if (end - c < 4)
+ if (end - c < 3)
break;
if (isalpha((unsigned char)c[-2]) &&
isalpha((unsigned char)c[-1]) &&