<commit_before>/* 
** Copyright 2001, <NAME>. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#include <string.h>
#include <ctype.h>
#include <sys/types.h>

int
strnicmp(char const *s1, char const *s2, size_t len)
{
	unsigned char c1 = '\0';
	unsigned char c2 = '\0';

	if(len > 0) {
		do {
			c1 = *s1; c2 = *s2;
			s1++; s2++;
			if(!c1)
				break;
			if(!c2)
				break;
			if(c1 == c2)
				continue;
			c1 = tolower(c1);
			c2 = tolower(c2);
			if (c1 != c2)
				break;
		} while(--len);
	}
	return (int)c1 - (int)c2;
}
#pragma weak "strncasecmp"="strnicmp"<commit_msg>Grrr, turns out the 'fix' in checkin #1493 really just fixed a bug in gcc 3.1, but breaks on earlier versions of gcc. Basically you can't use #pragma weak in 3.1, looks like it was fixed after the release. This checkin undoes the earlier one, I'll just deal with it until I get a newer gcc.<commit_after>/* 
** Copyright 2001, <NAME>. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#include <string.h>
#include <ctype.h>
#include <sys/types.h>

int
strnicmp(char const *s1, char const *s2, size_t len)
{
	unsigned char c1 = '\0';
	unsigned char c2 = '\0';

	if(len > 0) {
		do {
			c1 = *s1; c2 = *s2;
			s1++; s2++;
			if(!c1)
				break;
			if(!c2)
				break;
			if(c1 == c2)
				continue;
			c1 = tolower(c1);
			c2 = tolower(c2);
			if (c1 != c2)
				break;
		} while(--len);
	}
	return (int)c1 - (int)c2;
}
#pragma weak strncasecmp=strnicmp
{'fraction_non_alphanumeric': 0.15661016949152542, 'fraction_numerical': 0.04474576271186441, 'mean_word_length': 3.0217983651226157, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1750666', 'n_tokens_mistral': 683, 'n_tokens_neox': 596, 'n_words': 192}