Fixed compare function to do first char comparison in unsigned mode,

for consistency with the way other characters are compared.
This commit is contained in:
Guido van Rossum 1996-10-23 14:19:40 +00:00
parent 149574767c
commit fde7a75b78
1 changed files with 1 additions and 1 deletions

View File

@ -394,7 +394,7 @@ string_compare(a, b)
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)