Merged revisions 87442 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r87442 | alexander.belopolsky | 2010-12-22 21:27:37 -0500 (Wed, 22 Dec 2010) | 1 line
Issue #10254: Fixed a crash and a regression introduced by the implementation of PRI 29.
........
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index 5560dac..1a55696 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -684,10 +684,14 @@
comb = 0;
while (i1 < end) {
int comb1 = _getrecord_ex(*i1)->combining;
- if (comb && (comb1 == 0 || comb == comb1)) {
- /* Character is blocked. */
- i1++;
- continue;
+ if (comb) {
+ if (comb1 == 0)
+ break;
+ if (comb >= comb1) {
+ /* Character is blocked. */
+ i1++;
+ continue;
+ }
}
l = find_nfc_index(self, nfc_last, *i1);
/* *i1 cannot be combined with *i. If *i1
@@ -711,6 +715,7 @@
/* Replace the original character. */
*i = code;
/* Mark the second character unused. */
+ assert(cskipped < 20);
skipped[cskipped++] = i1;
i1++;
f = find_nfc_index(self, nfc_first, *i);