4 Copyright (C) 1992, 1996 Free Software Foundation, Inc.
5 This file is part of the GNU C Library.
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library; see the file COPYING.LIB. If
19 not, write to the Free Software Foundation, Inc., 51 Franklin Street,
20 Fifth Floor, Boston, MA 02110-1301 USA. */
26 /* Compare no more than N characters of S1 and S2,
27 ignoring case, returning less than, equal to or
28 greater than zero if S1 is lexicographically less
29 than, equal to or greater than S2. */
31 strncasecmp (const char *s1
, const char *s2
, size_t n
)
33 register const unsigned char *p1
= (const unsigned char *) s1
;
34 register const unsigned char *p2
= (const unsigned char *) s2
;
37 if (p1
== p2
|| n
== 0)
44 if (c1
== '\0' || c1
!= c2
)