diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2011-09-19 08:34:45 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2011-09-19 08:34:45 +0000 |
commit | 8c76f32c930d4fac4fe4b05aacc9b57b7e190516 (patch) | |
tree | 0069f9123d98fb2478bbe00e83c78af1c664fecf /roff.c | |
parent | a3b1c69e9d6c4f3ba1529d6530ff694f80926242 (diff) | |
download | mandoc-8c76f32c930d4fac4fe4b05aacc9b57b7e190516.tar.gz |
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 | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -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++; } |