ref: 2325263eb0da12d2ff37b58bbe2f70428237229b
parent: eb3870332f30b4726793496e1513ff9016f68d6f
author: Ali Gholami Rudi <ali@rudi.ir>
date: Mon Dec 15 11:20:54 EST 2014
hyph: handle non-alpha ascii characters in hcode_mapchar()
--- a/hyph.c
+++ b/hyph.c
@@ -151,8 +151,8 @@
int i = dict_get(hcodedict, s);
if (i >= 0)
strcpy(s, hcodedst[i]);
- else if (isalpha((unsigned char) *s))
- *s = tolower(*s);
+ else if (!s[1])
+ *s = isalpha((unsigned char) *s) ? tolower((unsigned char) *s) : '.';
return strlen(s);
}
--- a/wb.c
+++ b/wb.c
@@ -176,7 +176,7 @@
return 1;
if (!strcmp(c_bp, s))
continue;
- if (!utf8one(s) || (!s[1] && !isalpha((unsigned char) s[0])))
+ if (!utf8one(s))
strcpy(d, ".");
else
strcpy(d, s);