[uim-commit] r808 - trunk/uim
ekato at freedesktop.org
ekato at freedesktop.org
Wed Mar 23 03:29:16 PST 2005
Author: ekato
Date: 2005-03-23 03:29:13 -0800 (Wed, 23 Mar 2005)
New Revision: 808
Modified:
trunk/uim/skk-dic.c
Log:
* uim/skk-dic.c : Fix non portable use of isalpha() and isdigit().
Thanks to Masanari Yamamoto.
(parse_dic_line) : Fix invalid selection of the alphabetical word
starting with a capital letter and ending with a small letter.
Modified: trunk/uim/skk-dic.c
===================================================================
--- trunk/uim/skk-dic.c 2005-03-21 16:38:10 UTC (rev 807)
+++ trunk/uim/skk-dic.c 2005-03-23 11:29:13 UTC (rev 808)
@@ -143,7 +143,7 @@
}
/* check previous character */
b--;
- if (isalpha(*b)) {
+ if (isalpha((unsigned char)*b)) {
return 1;
}
return 0;
@@ -731,7 +731,7 @@
len = strlen(str);
for (i = 0; i < len; i++) {
- if (isdigit(str[i])) {
+ if (isdigit((unsigned char)str[i])) {
if (prev_is_num == 0) {
start = i;
numlen = 1;
@@ -1079,7 +1079,7 @@
newlen = len;
for (i = 0, j = 0; j < len; i++, j++) {
- if (isdigit(str[i])) {
+ if (isdigit((unsigned char)str[i])) {
if (prev_is_num == 0) {
str[i] = '#';
} else {
@@ -1108,7 +1108,7 @@
p = strstr(cand, "#4");
if (p) {
for (i = 0; i < len; i++) {
- if (cand[i] == '#' && isdigit(cand[i + 1])) {
+ if (cand[i] == '#' && isdigit((unsigned char)cand[i + 1])) {
(*nth)++;
if (cand[i + 1] == '4')
break;
@@ -1705,7 +1705,7 @@
return ;
}
*sep = '\0';
- if (!islower(buf[0]) && islower(sep[-1])) { /* okuri-ari entry */
+ if (!isalpha((unsigned char)buf[0]) && islower((unsigned char)sep[-1])) { /* okuri-ari entry */
char okuri_head = sep[-1];
sep[-1] = 0;
sl = compose_line(di, buf, okuri_head, line);
More information about the Uim-commit
mailing list