summaryrefslogtreecommitdiff
path: root/libc/string/strcasecmp.c
blob: c6144ff23f2f0b5332192f4f2561ac9b05a86703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk>
 * This file is part of the Linux-8086 C library and is distributed
 * under the GNU Library General Public License.
 */

#include <string.h>
#include <ctype.h>

int
strcasecmp(s, d)
const char *s;
const char *d;
{
   for(;;)
   {
      if( *s != *d )
      {
	 if( tolower(*s) != tolower(*d) )
	    return *s - *d;
      }
      else if( *s == '\0' ) break;
      s++; d++;
   }
   return 0;
}