diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-04 11:53:01 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-04 11:53:01 (GMT) |
commit | 061fe342622f94a199f43976d98a66373c6cdd1e (patch) | |
tree | af7824784098c2fbc0cc047ed65928979c22d57c /Modules/unicodedata.c | |
parent | 8e4dd08f23c4c52d136c38943041c9b5f14eaf42 (diff) | |
parent | ed8ba14441d5a9c97c0cb8ba9e262595cf94dd1a (diff) | |
download | cpython-061fe342622f94a199f43976d98a66373c6cdd1e.zip cpython-061fe342622f94a199f43976d98a66373c6cdd1e.tar.gz cpython-061fe342622f94a199f43976d98a66373c6cdd1e.tar.bz2 |
Remove all other uses of the C tolower()/toupper() which could break with a Turkish locale.
Diffstat (limited to 'Modules/unicodedata.c')
-rw-r--r-- | Modules/unicodedata.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c index 1dacf88..03ec65a 100644 --- a/Modules/unicodedata.c +++ b/Modules/unicodedata.c @@ -875,7 +875,7 @@ _gethash(const char *s, int len, int scale) unsigned long h = 0; unsigned long ix; for (i = 0; i < len; i++) { - h = (h * scale) + (unsigned char) toupper(Py_CHARMASK(s[i])); + h = (h * scale) + (unsigned char) Py_TOUPPER(Py_CHARMASK(s[i])); ix = h & 0xff000000; if (ix) h = (h ^ ((ix>>24) & 0xff)) & 0x00ffffff; @@ -1025,7 +1025,7 @@ _cmpname(PyObject *self, int code, const char* name, int namelen) if (!_getucname(self, code, buffer, sizeof(buffer))) return 0; for (i = 0; i < namelen; i++) { - if (toupper(Py_CHARMASK(name[i])) != buffer[i]) + if (Py_TOUPPER(Py_CHARMASK(name[i])) != buffer[i]) return 0; } return buffer[namelen] == '\0'; |