summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-12-28 16:15:08 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-12-28 16:15:08 (GMT)
commit893c354a556fa3731644d6698d47c1112bd4b45a (patch)
tree06a461cad8f2b190145eca3b9372232001bccd02 /Modules
parent8497f0a85d97e1d9660bbb450ba9f2dc8b03f87d (diff)
downloadcpython-893c354a556fa3731644d6698d47c1112bd4b45a.zip
cpython-893c354a556fa3731644d6698d47c1112bd4b45a.tar.gz
cpython-893c354a556fa3731644d6698d47c1112bd4b45a.tar.bz2
Merged revisions 87541,87543 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint ................ r87541 | alexander.belopolsky | 2010-12-28 10:47:56 -0500 (Tue, 28 Dec 2010) | 9 lines 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. ........ ................ r87543 | alexander.belopolsky | 2010-12-28 11:04:06 -0500 (Tue, 28 Dec 2010) | 1 line fixed issue 10254 test ................
Diffstat (limited to 'Modules')
-rw-r--r--Modules/unicodedata.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index 8291d58..03b8690 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -681,10 +681,14 @@ nfc_nfkc(PyObject *self, PyObject *input, int k)
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
@@ -708,6 +712,7 @@ nfc_nfkc(PyObject *self, PyObject *input, int k)
/* 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);