OLD | NEW |
| (Empty) |
1 Index: source/i18n/ucol.cpp | |
2 =================================================================== | |
3 --- source/i18n/ucol.cpp (revision 292709) | |
4 +++ source/i18n/ucol.cpp (working copy) | |
5 @@ -2259,6 +2259,9 @@ inline UChar getNextNormalizedChar(collIterate *data) | |
6 if (data->pos + 1 == data->endp) { | |
7 return *(data->pos ++); | |
8 } | |
9 + if (data->pos >= data->endp) { | |
10 + return (UChar) -1; // return U+FFFF (non-char) to indicate an error | |
11 + } | |
12 } | |
13 else { | |
14 if (innormbuf) { | |
15 @@ -2820,8 +2823,14 @@ uint32_t ucol_prv_getSpecialCE(const UCollator *coll, UCh
ar ch, uint32_t CE, col | |
16 goBackOne(source); | |
17 } | |
18 } | |
19 - } else if (U16_IS_LEAD(schar)) { | |
20 - miss = U16_GET_SUPPLEMENTARY(schar, getNextNormaliz
edChar(source)); | |
21 + } else if (U16_IS_LEAD(schar) && source->pos + 1 < sour
ce->endp) { | |
22 + const UChar* prevPos = source->pos; | |
23 + UChar nextChar = getNextNormalizedChar(source); | |
24 + if (U16_IS_TRAIL(nextChar)) { | |
25 + miss = U16_GET_SUPPLEMENTARY(schar, nextChar); | |
26 + } else if (prevPos < source->pos) { | |
27 + goBackOne(source); | |
28 + } | |
29 } | |
30 | |
31 uint8_t sCC; | |
OLD | NEW |