Mercurial > cpython-lru_cache-weakref
view Python/pystrcmp.c @ 45919:855c4290dfd7 legacy-trunk
Fix the tcl-8.4.18.1 path and make sure we cd into the right directory when building tcl/tk.
| author | Trent Nelson <trent.nelson@snakebite.org> |
|---|---|
| date | Wed, 19 Mar 2008 08:06:03 +0000 |
| parents | 4dc01402d78a |
| children | 0a485593ae1c |
line wrap: on
line source
/* Cross platform case insenstive 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(*s1) == tolower(*s2))) { if (!*s1++ || !*s2++) break; } return tolower(*s1) - tolower(*s2); } int PyOS_mystricmp(const char *s1, const char *s2) { while (*s1 && (tolower(*s1++) == tolower(*s2++))) { ; } return (tolower(*s1) - tolower(*s2)); }
