1 /* strcasecmp.c - case-insensitive strcmp
3 Copyright 2008 Karl Berry.
4 Copyright 1991, 1992, 1995 Free Software Foundation, Inc.
5 This file was part of the GNU C Library.
6 Modified by Karl Berry for kpathsea.
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with this library; if not, see <http://www.gnu.org/licenses/>. */
25 #if !defined (__STDC__) || !__STDC__
26 /* This is a separate conditional since some stdc systems
27 reject `defined (const)'. */
35 /* Compare S1 and S2, ignoring case, returning less than, equal to or
36 greater than zero if S1 is lexiographically less than,
37 equal to or greater than S2. */
43 register const unsigned char *p1 = (const unsigned char *) s1;
44 register const unsigned char *p2 = (const unsigned char *) s2;
63 strncasecmp (s1, s2, n)
68 register const unsigned char *p1 = (const unsigned char *) s1;
69 register const unsigned char *p2 = (const unsigned char *) s2;
72 if (p1 == p2 || n == 0)
79 if (c1 == '\0' || c1 != c2)