Blame python-2.5.1-codec-ascii-tolower.patch

59062c
diff -rup Python-2.5.1-orig/Python/codecs.c Python-2.5.1/Python/codecs.c
59062c
--- Python-2.5.1-orig/Python/codecs.c	2006-06-23 17:16:18.000000000 -0400
59062c
+++ Python-2.5.1/Python/codecs.c	2007-10-30 12:51:10.000000000 -0400
59062c
@@ -45,6 +45,11 @@ int PyCodec_Register(PyObject *search_fu
59062c
     return -1;
59062c
 }
59062c
 
59062c
+/* isupper() forced into the ASCII Locale */
59062c
+#define ascii_isupper(x) (((x) >= 0x41) && ((x) <= 0x5A))
59062c
+/* tolower() forced into the ASCII Locale */
59062c
+#define ascii_tolower(x) (ascii_isupper(x) ? ((x) + 0x20) : (x))
59062c
+
59062c
 /* Convert a string to a normalized Python string: all characters are
59062c
    converted to lower case, spaces are replaced with underscores. */
59062c
 
59062c
@@ -70,7 +75,7 @@ PyObject *normalizestring(const char *st
59062c
         if (ch == ' ')
59062c
             ch = '-';
59062c
         else
59062c
-            ch = tolower(Py_CHARMASK(ch));
59062c
+            ch = ascii_tolower(Py_CHARMASK(ch));
59062c
 	p[i] = ch;
59062c
     }
59062c
     return v;
59062c
Only in Python-2.5.1/Python: codecs.c~