Fix generic changelog entry.
[fedora-mingw.git] / python / python-2.5.1-codec-ascii-tolower.patch
1 diff -rup Python-2.5.1-orig/Python/codecs.c Python-2.5.1/Python/codecs.c
2 --- Python-2.5.1-orig/Python/codecs.c   2006-06-23 17:16:18.000000000 -0400
3 +++ Python-2.5.1/Python/codecs.c        2007-10-30 12:51:10.000000000 -0400
4 @@ -45,6 +45,11 @@ int PyCodec_Register(PyObject *search_fu
5      return -1;
6  }
7  
8 +/* isupper() forced into the ASCII Locale */
9 +#define ascii_isupper(x) (((x) >= 0x41) && ((x) <= 0x5A))
10 +/* tolower() forced into the ASCII Locale */
11 +#define ascii_tolower(x) (ascii_isupper(x) ? ((x) + 0x20) : (x))
12 +
13  /* Convert a string to a normalized Python string: all characters are
14     converted to lower case, spaces are replaced with underscores. */
15  
16 @@ -70,7 +75,7 @@ PyObject *normalizestring(const char *st
17          if (ch == ' ')
18              ch = '-';
19          else
20 -            ch = tolower(Py_CHARMASK(ch));
21 +            ch = ascii_tolower(Py_CHARMASK(ch));
22         p[i] = ch;
23      }
24      return v;
25 Only in Python-2.5.1/Python: codecs.c~