From 80a2117d1c762a36f59899a3fa11da69900d340b Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 19 Sep 2011 08:34:45 +0000 Subject: Breaking the line at a hyphen is only allowed if the hyphen is both preceded and followed by an alphabetic character. ok kristaps@ --- roff.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/roff.c b/roff.c index 18b7aa65..2e2a52a6 100644 --- a/roff.c +++ b/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.170 2011/09/18 23:51:31 schwarze Exp $ */ +/* $Id: roff.c,v 1.171 2011/09/19 08:34:45 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -556,7 +556,6 @@ again: static enum rofferr roff_parsetext(char *p) { - char l, r; size_t sz; const char *start; enum mandoc_esc esc; @@ -583,14 +582,8 @@ roff_parsetext(char *p) continue; } - l = *(p - 1); - r = *(p + 1); - if ('\\' != l && - '\t' != r && '\t' != l && - ' ' != r && ' ' != l && - '-' != r && '-' != l && - ! isdigit((unsigned char)l) && - ! isdigit((unsigned char)r)) + if (isalpha((unsigned char)p[-1]) && + isalpha((unsigned char)p[1])) *p = ASCII_HYPH; p++; } -- cgit v1.2.3-56-ge451