[Python-checkins] python/dist/src/Modules unicodedata.c,2.29,2.30
loewis at users.sourceforge.net
loewis at users.sourceforge.net
Sat Apr 17 15:36:51 EDT 2004
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31584/Modules
Modified Files:
unicodedata.c
Log Message:
Special case normalization of empty strings. Fixes #924361.
Backported to 2.3.
Index: unicodedata.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/unicodedata.c,v
retrieving revision 2.29
retrieving revision 2.30
diff -C2 -d -r2.29 -r2.30
*** unicodedata.c 6 Nov 2003 20:47:57 -0000 2.29
--- unicodedata.c 17 Apr 2004 19:36:48 -0000 2.30
***************
*** 516,519 ****
--- 516,526 ----
return NULL;
+ if (PyUnicode_GetSize(input) == 0) {
+ /* Special case empty input strings, since resizing
+ them later would cause internal errors. */
+ Py_INCREF(input);
+ return input;
+ }
+
if (strcmp(form, "NFC") == 0)
return nfc_nfkc(input, 0);
More information about the Python-checkins
mailing list