1/* 2 * $Id: strcasecmp.c,v 1.1.1.1 2008/10/15 03:30:50 james26_jang Exp $ 3 * 4 * Copyright (C) 1996 Lars Fenneberg and Christian Graefe 5 * 6 * This file is provided under the terms and conditions of the GNU general 7 * public license, version 2 or any later version, incorporated herein by 8 * reference. 9 * 10 */ 11 12#include "config.h" 13#include "includes.h" 14 15#ifdef HAVE_STRICMP 16# define strcasecmp(a,b) stricmp(a,b) 17#else 18 19/* 20 * Function: strcasecmp 21 * 22 * Purpose: strcasecmp replacement for systems which lack strcasecmp and 23 * stricmp 24 */ 25 26int strcasecmp(char *s1, char *s2) 27{ 28 while (*s1 && *s2 && toupper(*s1) == toupper(*s2)) 29 s1++, s2++; 30 31 if (!*s1 && !*s2) 32 return 0; 33 else 34 return (toupper(*s1) - toupper(*s2)); 35} 36#endif 37