mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
python-3.6.zip added from Github
README.cosmo contains the necessary links.
This commit is contained in:
parent
75fc601ff5
commit
0c4c56ff39
4219 changed files with 1968626 additions and 0 deletions
26
third_party/python/Python/pystrcmp.c
vendored
Normal file
26
third_party/python/Python/pystrcmp.c
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
/* 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));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue