diff options
author | 2011-09-19 08:34:45 +0000 | |
---|---|---|
committer | 2011-09-19 08:34:45 +0000 | |
commit | 80a2117d1c762a36f59899a3fa11da69900d340b (patch) | |
tree | faf3a0702e7523104d96e811e6547b9e18d4da35 /roff.c | |
parent | 42c0d6412f67fc0af50b2f3219644a1adbe028f2 (diff) | |
download | mandoc-80a2117d1c762a36f59899a3fa11da69900d340b.tar.gz mandoc-80a2117d1c762a36f59899a3fa11da69900d340b.tar.zst mandoc-80a2117d1c762a36f59899a3fa11da69900d340b.zip |
Breaking the line at a hyphen is only allowed if the hyphen
is both preceded and followed by an alphabetic character.
ok kristaps@
Diffstat (limited to 'roff.c')
-rw-r--r-- | roff.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -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 <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -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++; } |