aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit9d0aa71fc423408e9d933f17f51c1ef0f9ea041b (patch)
tree5d42e94f1ff5dd870f1072c999b67cdeb0345ebb /mdoc.c
parent587571c6dd712d9ee39e2984b08958c5243eca99 (diff)
downloadmandoc-9d0aa71fc423408e9d933f17f51c1ef0f9ea041b.tar.gz
mandoc-9d0aa71fc423408e9d933f17f51c1ef0f9ea041b.tar.zst
mandoc-9d0aa71fc423408e9d933f17f51c1ef0f9ea041b.zip
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mdoc.c b/mdoc.c
index 26fd8277..7ad087e0 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.264 2017/05/05 15:17:32 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.265 2017/06/07 20:30:40 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -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]) &&