From 9d0aa71fc423408e9d933f17f51c1ef0f9ea041b Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 7 Jun 2017 20:30:40 +0000 Subject: 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... --- mdoc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mdoc.c') 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 * Copyright (c) 2010, 2012-2017 Ingo Schwarze @@ -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]) && -- cgit v1.2.3-56-ge451