This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kakkoko
Recipients kakkoko
Date 2014-09-03.09:04:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1409735069.35.0.121112016094.issue22330@psf.upfronthosting.co.za>
In-reply-to
Content
int x = PyOS_mystricmp("foo", "none");
expected: x < 0
actual:   x == 0

    while (*s1 && (tolower((unsigned)*s1++) == tolower((unsigned)*s2++))) {
        ;
    }
    return (tolower((unsigned)*s1) - tolower((unsigned)*s2));

The while-loop is finished when *s1 != *s2 (ex. *s1 == 'f', *s2 == 'n'), but s1 and s2 already point to next characters (ex. *s1 == 'o', *s2 == 'o'), so PyOS_mystricmp returns difference between these characters.
History
Date User Action Args
2014-09-03 09:04:29kakkokosetrecipients: + kakkoko
2014-09-03 09:04:29kakkokosetmessageid: <1409735069.35.0.121112016094.issue22330@psf.upfronthosting.co.za>
2014-09-03 09:04:29kakkokolinkissue22330 messages
2014-09-03 09:04:29kakkokocreate