X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=libatalk%2Funicode%2Futil_unistr.c;h=ef48f21b27841b3d2920cf19972e7c5b2e95ad18;hp=21dd156ae16cd04bc715fd3d3453a44770ddfe06;hb=27e6e84ca19b6def0c7cf97aedcfde6020007ad8;hpb=6815f8ba1a1a7f46fc3855d4f942f2bd28f25539 diff --git a/libatalk/unicode/util_unistr.c b/libatalk/unicode/util_unistr.c index 21dd156a..ef48f21b 100644 --- a/libatalk/unicode/util_unistr.c +++ b/libatalk/unicode/util_unistr.c @@ -449,7 +449,7 @@ size_t precompose_w (ucs2_t *name, size_t inplen, ucs2_t *comp, size_t *outlen) ucs2_t base, comb; u_int32_t base_sp, comb_sp; ucs2_t *in, *out; - ucs2_t hangul_lindex, hangul_vindex; + ucs2_t lindex, vindex; ucs2_t result; u_int32_t result_sp; size_t o_len = *outlen; @@ -482,20 +482,20 @@ size_t precompose_w (ucs2_t *name, size_t inplen, ucs2_t *comp, size_t *outlen) /* Unicode Standard Annex #15 A10.3 Hangul Composition */ /* Step 1 */ - else if ((HANGUL_VBASE <= comb) && (comb <= HANGUL_VBASE + HANGUL_VCOUNT)) { - if ((HANGUL_LBASE <= base) && (base < HANGUL_LBASE + HANGUL_LCOUNT)) { + else if ((VBASE <= comb) && (comb <= VBASE + VCOUNT)) { + if ((LBASE <= base) && (base < LBASE + LCOUNT)) { result = 1; - hangul_lindex = base - HANGUL_LBASE; - hangul_vindex = comb - HANGUL_VBASE; - base = HANGUL_SBASE + (hangul_lindex * HANGUL_VCOUNT + hangul_vindex) * HANGUL_TCOUNT; + lindex = base - LBASE; + vindex = comb - VBASE; + base = SBASE + (lindex * VCOUNT + vindex) * TCOUNT; } } /* Step 2 */ - else if ((HANGUL_TBASE < comb) && (comb < HANGUL_TBASE + HANGUL_TCOUNT)) { - if ((HANGUL_SBASE <= base) && (base < HANGUL_SBASE +HANGUL_SCOUNT) && (((base - HANGUL_SBASE) % HANGUL_TCOUNT) == 0)) { + else if ((TBASE < comb) && (comb < TBASE + TCOUNT)) { + if ((SBASE <= base) && (base < SBASE + SCOUNT) && (((base - SBASE) % TCOUNT) == 0)) { result = 1; - base += comb - HANGUL_TBASE; + base += comb - TBASE; } } @@ -557,7 +557,7 @@ size_t decompose_w (ucs2_t *name, size_t inplen, ucs2_t *comp, size_t *outlen) size_t comblen; ucs2_t base, comb[COMBBUFLEN]; u_int32_t base_sp; - ucs2_t hangul_sindex, tjamo; + ucs2_t sindex, tjamo; ucs2_t *in, *out; unsigned int result; u_int64_t result_sp; @@ -577,13 +577,13 @@ size_t decompose_w (ucs2_t *name, size_t inplen, ucs2_t *comp, size_t *outlen) if (base <= 0x007f) ; /* Unicode Standard Annex #15 A10.2 Hangul Decomposition */ - else if ((HANGUL_SBASE <= base) && (base < HANGUL_SBASE + HANGUL_SCOUNT)) { - hangul_sindex = base - HANGUL_SBASE; - base = HANGUL_LBASE + hangul_sindex / HANGUL_NCOUNT; - comb[COMBBUFLEN-2] = HANGUL_VBASE + (hangul_sindex % HANGUL_NCOUNT) / HANGUL_TCOUNT; + else if ((SBASE <= base) && (base < SBASE + SCOUNT)) { + sindex = base - SBASE; + base = LBASE + sindex / NCOUNT; + comb[COMBBUFLEN-2] = VBASE + (sindex % NCOUNT) / TCOUNT; /* */ - if ((tjamo = HANGUL_TBASE + hangul_sindex % HANGUL_TCOUNT) == HANGUL_TBASE) { + if ((tjamo = TBASE + sindex % TCOUNT) == TBASE) { comb[COMBBUFLEN-1] = comb[COMBBUFLEN-2]; comblen = 1; }