From f7444fab8606a20ee38d7a9d89bfede0942240de Mon Sep 17 00:00:00 2001 From: schwarze Date: Wed, 7 Jun 2017 20:30:13 +0000 Subject: [PATCH] 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 . It's merely a three-bit diff, changing one byte from 0x34 to 0x33, so what can possibly go wrong... --- usr.bin/mandoc/mdoc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c index 076f2a7ffc5..a788941604a 100644 --- a/usr.bin/mandoc/mdoc.c +++ b/usr.bin/mandoc/mdoc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc.c,v 1.153 2017/05/05 15:16:25 schwarze Exp $ */ +/* $OpenBSD: mdoc.c,v 1.154 2017/06/07 20:30:13 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2017 Ingo Schwarze @@ -276,7 +276,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]) && -- 2.20.1