summaryrefslogtreecommitdiffstats
path: root/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2011-09-19 08:34:45 +0000
committerIngo Schwarze <schwarze@openbsd.org>2011-09-19 08:34:45 +0000
commit8c76f32c930d4fac4fe4b05aacc9b57b7e190516 (patch)
tree0069f9123d98fb2478bbe00e83c78af1c664fecf /roff.c
parenta3b1c69e9d6c4f3ba1529d6530ff694f80926242 (diff)
downloadmandoc-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.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/roff.c b/roff.c
index 74401735..83b5e8b6 100644
--- a/roff.c
+++ b/roff.c
@@ -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++;
}