Staging
v0.8.1
https://github.com/python/cpython
Revision b01f94324a95657b613f7d1ef7dca1a4e31af123 authored by Georg Brandl on 13 March 2010, 10:59:09 UTC, committed by Georg Brandl on 13 March 2010, 10:59:09 UTC
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78910 | georg.brandl | 2010-03-13 11:54:12 +0100 (Sa, 13 Mär 2010) | 1 line

  Bump externals versions for doc build.
........
1 parent de1838c
Raw File
Tip revision: b01f94324a95657b613f7d1ef7dca1a4e31af123 authored by Georg Brandl on 13 March 2010, 10:59:09 UTC
Merged revisions 78910 via svnmerge from
Tip revision: b01f943
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