Staging
v0.5.1
https://github.com/torvalds/linux
Raw File
Tip revision: 826eeb53a6f264842200d3311d69107d2eb25f5e authored by Linus Torvalds on 03 February 2006, 06:03:08 UTC
Linux v2.6.16-rc2
Tip revision: 826eeb5
strcasecmp.c
/*
 *  linux/arch/alpha/lib/strcasecmp.c
 */

#include <linux/string.h>


/* We handle nothing here except the C locale.  Since this is used in
   only one place, on strings known to contain only 7 bit ASCII, this
   is ok.  */

int strcasecmp(const char *a, const char *b)
{
	int ca, cb;

	do {
		ca = *a++ & 0xff;
		cb = *b++ & 0xff;
		if (ca >= 'A' && ca <= 'Z')
			ca += 'a' - 'A';
		if (cb >= 'A' && cb <= 'Z')
			cb += 'a' - 'A';
	} while (ca == cb && ca != '\0');

	return ca - cb;
}
back to top