Mercurial > cpython-lru_cache-weakref
diff Objects/stringobject.c @ 4458:d8759d0b5a67 legacy-trunk
Fixed compare function to do first char comparison in unsigned mode,
for consistency with the way other characters are compared.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 23 Oct 1996 14:19:40 +0000 |
| parents | 839f72610ae1 |
| children | 65d2d8e67da3 |
line wrap: on
line diff
--- a/Objects/stringobject.c Wed Oct 23 14:16:28 1996 +0000 +++ b/Objects/stringobject.c Wed Oct 23 14:19:40 1996 +0000 @@ -394,7 +394,7 @@ int min_len = (len_a < len_b) ? len_a : len_b; int cmp; if (min_len > 0) { - cmp = *a->ob_sval - *b->ob_sval; + cmp = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval); if (cmp == 0) cmp = memcmp(a->ob_sval, b->ob_sval, min_len); if (cmp != 0)
