source:
git/src/strcasecmp.c
@
daf88e1
Last change on this file since daf88e1 was 23b9fda, checked in by , 26 years ago | |
---|---|
|
|
File size: 365 bytes |
Rev | Line | |
---|---|---|
[1f04920] | 1 | /* portable case insensitive string compare */ |
[fe72b3a] | 2 | /* Copyright (C) Olly Betts 1994,1999 */ |
[1f04920] | 3 | |
4 | #include <ctype.h> | |
5 | ||
6 | /* What about top bit set chars? */ | |
[fe72b3a] | 7 | int strcasecmp(const char *s1, const char *s2) { |
8 | register c1, c2; | |
[1f04920] | 9 | do { |
10 | c1 = *s1++; | |
11 | c2 = *s2++; | |
[23b9fda] | 12 | } while (c1 && toupper(c1) == toupper(c2)); |
[fe72b3a] | 13 | /* now calculate real difference */ |
[1f04920] | 14 | return c1 - c2; |
15 | } |
Note: See TracBrowser
for help on using the repository browser.