diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2011-09-19 07:53:55 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2011-09-19 07:53:55 +0000 |
commit | 511732a7c72918385cc43cb391cca39477b4d32c (patch) | |
tree | ce5ceed4fb1a0f4270579cf56b4a88a7910e48cf /usr.bin | |
parent | 16b6dd8fc1b500f32f425069726c226265a91909 (diff) |
Breaking the line at a hyphen is only allowed if the hyphen
is both preceded and followed by an alphabetic character.
This fixes about a dozen places in base.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/roff.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c index d79c70242ba..b9e04fc4bfb 100644 --- a/usr.bin/mandoc/roff.c +++ b/usr.bin/mandoc/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.43 2011/09/18 23:26:18 schwarze Exp $ */ +/* $Id: roff.c,v 1.44 2011/09/19 07:53:54 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -552,7 +552,6 @@ again: static enum rofferr roff_parsetext(char *p) { - char l, r; size_t sz; const char *start; enum mandoc_esc esc; @@ -579,14 +578,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++; } |