add case sensitive matching
This commit is contained in:
14
byte_case_diff.c
Normal file
14
byte_case_diff.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <ctype.h>
|
||||
|
||||
int byte_case_diff(const void* a, unsigned int len, const void* b) {
|
||||
register const char* s=a;
|
||||
register const char* t=b;
|
||||
register const char* u=t+len;
|
||||
register int j;
|
||||
j=0;
|
||||
for (;;) {
|
||||
if (t==u) break; if ((j=(tolower(*s)-tolower(*t)))) break; ++s; ++t;
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user