Commit 0f75384f authored by Guido van Rossum's avatar Guido van Rossum

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

for consistency with the way other characters are compared.
parent fd54e7dc
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment