RELEASE/1.0RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernlogstereowalls-datawalls-data-hanging-as-warning
Line | |
---|
1 | /* portable case insensitive string compare */ |
---|
2 | /* Copyright (C) Olly Betts 1994,1999 |
---|
3 | * |
---|
4 | * This program is free software; you can redistribute it and/or |
---|
5 | * modify it under the terms of the GNU General Public |
---|
6 | * License as published by the Free Software Foundation; either |
---|
7 | * version 2 of the License, or (at your option) any later version. |
---|
8 | * |
---|
9 | * This program is distributed in the hope that it will be useful, |
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
12 | * General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU General Public |
---|
15 | * License along with this program; if not, write to the Free |
---|
16 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
17 | */ |
---|
18 | |
---|
19 | #include <ctype.h> |
---|
20 | |
---|
21 | /* What about top bit set chars? */ |
---|
22 | int strcasecmp(const char *s1, const char *s2) { |
---|
23 | register c1, c2; |
---|
24 | do { |
---|
25 | c1 = *s1++; |
---|
26 | c2 = *s2++; |
---|
27 | } while (c1 && toupper(c1) == toupper(c2)); |
---|
28 | /* now calculate real difference */ |
---|
29 | return c1 - c2; |
---|
30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.