diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-08-15 06:09:57 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-08-15 06:09:57 (GMT) |
commit | ee8d998ecfd7d7fec71610adef1127d6d95ca843 (patch) | |
tree | fccf446fb7b8ea7aa044e321c367ccd85fa9d94d /Objects/unicodeobject.c | |
parent | 388c945e9735864bb75f10ecfa22528c91b6a56c (diff) | |
download | cpython-ee8d998ecfd7d7fec71610adef1127d6d95ca843.zip cpython-ee8d998ecfd7d7fec71610adef1127d6d95ca843.tar.gz cpython-ee8d998ecfd7d7fec71610adef1127d6d95ca843.tar.bz2 |
#12266: Fix str.capitalize() to correctly uppercase/lowercase titlecased and cased non-letter characters.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index a48b8b4..77f8dd5 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -6658,13 +6658,13 @@ int fixcapitalize(PyUnicodeObject *self) if (len == 0) return 0; - if (Py_UNICODE_ISLOWER(*s)) { + if (!Py_UNICODE_ISUPPER(*s)) { *s = Py_UNICODE_TOUPPER(*s); status = 1; } s++; while (--len > 0) { - if (Py_UNICODE_ISUPPER(*s)) { + if (!Py_UNICODE_ISLOWER(*s)) { *s = Py_UNICODE_TOLOWER(*s); status = 1; } |