source:
trunk/sys/dietlibc/strcasecmp.c
@
131
Last change on this file since 131 was 1, checked in by , 8 years ago | |
---|---|
File size: 393 bytes |
Rev | Line | |
---|---|---|
[1] | 1 | #include <strings.h> |
2 | ||
3 | int strcasecmp ( const char* s1, const char* s2 ) | |
4 | { | |
5 | register unsigned int x2; | |
6 | register unsigned int x1; | |
7 | ||
8 | while (1) { | |
9 | x2 = *s2 - 'A'; if (x2 < 26u) x2 += 32; | |
10 | x1 = *s1 - 'A'; if (x1 < 26u) x1 += 32; | |
11 | s1++; s2++; | |
12 | if ( x2 != x1 ) | |
13 | break; | |
14 | if ( x1 == (unsigned int)-'A') | |
15 | break; | |
16 | } | |
17 | ||
18 | return x1 - x2; | |
19 | } |
Note: See TracBrowser
for help on using the repository browser.