Staging
v0.5.1
https://github.com/python/cpython
Revision 87b4e726bed0dfa7071ffc5528969039a96ea0c4 authored by Philip Jenvey on 29 September 2009, 04:41:54 UTC, committed by Philip Jenvey on 29 September 2009, 04:41:54 UTC
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75123 | philip.jenvey | 2009-09-28 21:32:44 -0700 (Mon, 28 Sep 2009) | 4 lines

  #6990: clear threading.local's key only after its thread state is removed:
  fixes local subclasses leaving old state around after a ref cycle GC which
  could be recycled by new locals
........
1 parent a89633c
Raw File
Tip revision: 87b4e726bed0dfa7071ffc5528969039a96ea0c4 authored by Philip Jenvey on 29 September 2009, 04:41:54 UTC
Merged revisions 75123 via svnmerge from
Tip revision: 87b4e72
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