diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-07-27 14:19:26 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-07-27 14:19:26 +0000 |
commit | b48d1093b6bfb6d254e9d96a70319ef2563f49f7 (patch) | |
tree | 80ac410873e4c61b1d3f960a2e41339a3419b263 /roff.c | |
parent | a246292f836147375dc6f624f58cc10c9f0d4f39 (diff) | |
download | mandoc-b48d1093b6bfb6d254e9d96a70319ef2563f49f7.tar.gz |
Fix hyphen-replacement loop.
Diffstat (limited to 'roff.c')
-rw-r--r-- | roff.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -530,6 +530,9 @@ roff_parsetext(char *p) sz = strcspn(p, "-\\"); p += sz; + if ('\0' == *p) + break; + if ('\\' == *p) { /* Skip over escapes. */ p++; @@ -538,20 +541,19 @@ roff_parsetext(char *p) if (ESCAPE_ERROR == esc) break; continue; - } else if ('-' != *p || p == start) { + } else if (p == start) { 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)) + ! isdigit((unsigned char)r)) *p = ASCII_HYPH; p++; } |