summaryrefslogtreecommitdiff
path: root/Build/source/texk/upmendex/fwrite.c
diff options
context:
space:
mode:
authorTakuji Tanaka <ttk@t-lab.opal.ne.jp>2022-11-20 08:09:38 +0000
committerTakuji Tanaka <ttk@t-lab.opal.ne.jp>2022-11-20 08:09:38 +0000
commit2609330d04fe58864656ce2f23d6a307f9a72ff7 (patch)
treec5979aac54b95e5cec74a147bca8ba063bcd0820 /Build/source/texk/upmendex/fwrite.c
parent3cf6d7f77a0756aadb12c69f0d532e7aaa3acb75 (diff)
upmendex: ver1.07, Improve detection of hanzi header
git-svn-id: svn://tug.org/texlive/trunk@65057 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/upmendex/fwrite.c')
-rw-r--r--Build/source/texk/upmendex/fwrite.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/Build/source/texk/upmendex/fwrite.c b/Build/source/texk/upmendex/fwrite.c
index a27d269fb67..f33230df8e6 100644
--- a/Build/source/texk/upmendex/fwrite.c
+++ b/Build/source/texk/upmendex/fwrite.c
@@ -784,13 +784,13 @@ static void crcheck(char *lbuff, FILE *fp)
static void index_normalize(UChar *istr, UChar *ini, int *chset)
{
- int k, len, hi, lo, mi;
+ int k, hi, lo, mi;
UChar ch,src[2],dest[8],strX[4],strY[4],strZ[4];
UChar32 c32;
UErrorCode perr;
UCollationResult order;
UCollationStrength strgth;
- static int hanzi_mode=0, i_y_mode=0;
+ static int i_y_mode=0;
ch=istr[0];
*chset=charset(istr);
@@ -907,20 +907,17 @@ static void index_normalize(UChar *istr, UChar *ini, int *chset)
ini[0]=ch;
return;
}
- else if ((len=is_hanzi(istr))>0) {
+ else if (is_hanzi(istr)) {
if (hanzi_mode==0) hanzi_mode=init_hanzi_header();
if (hanzi_mode==HANZI_UNKNOWN) {
u_strcpy(ini, hz_index[0].idx);
return;
}
- strX[0] =istr[0];
- if (len==2){ strX[1] =istr[1]; }
- strX[len]=L'\0';
lo=0; hi=hz_index_len;
while (lo<hi) {
mi = (lo+hi)/2;
u_strcpy(strZ,hz_index[mi].threshold);
- order = ucol_strcoll(icu_collator, strZ, -1, strX, -1);
+ order = ucol_strcoll(icu_collator, strZ, -1, istr, -1);
if (order!=UCOL_GREATER) lo=mi+1;
else hi=mi;
}