Staging
v0.5.1
https://github.com/python/cpython
Revision c3cf97b4ea05fc79b7753c66e31d861cadb0607e authored by Zachary Ware on 17 January 2014, 21:23:42 UTC, committed by Zachary Ware on 17 January 2014, 21:23:42 UTC
Includes:
-mention cx_Freeze instead of py2exe (at least until py2exe supports Python 3)
-update ActivePython link
-Remove mention of platforms that were never supported by Python 3 (Win9x, DOS)
1 parent f348909
Raw File
Tip revision: c3cf97b4ea05fc79b7753c66e31d861cadb0607e authored by Zachary Ware on 17 January 2014, 21:23:42 UTC
Issue #20265: Updated some parts of the Using Windows document.
Tip revision: c3cf97b
pystrcmp.c
/* Cross platform case insensitive string compare functions
 */

#include "Python.h"

int
PyOS_mystrnicmp(const char *s1, const char *s2, Py_ssize_t size)
{
    if (size == 0)
        return 0;
    while ((--size > 0) &&
           (tolower((unsigned)*s1) == tolower((unsigned)*s2))) {
        if (!*s1++ || !*s2++)
            break;
    }
    return tolower((unsigned)*s1) - tolower((unsigned)*s2);
}

int
PyOS_mystricmp(const char *s1, const char *s2)
{
    while (*s1 && (tolower((unsigned)*s1++) == tolower((unsigned)*s2++))) {
        ;
    }
    return (tolower((unsigned)*s1) - tolower((unsigned)*s2));
}
back to top