static char rcsid[] = "@(#)$Id: strincmp.c,v 1.9 2006/04/09 07:37:05 hurtta Exp $";

/******************************************************************************
 *  The Elm (ME+) Mail System  -  $Revision: 1.9 $   $State: Exp $
 *
 *  Modified by: Kari Hurtta <hurtta+elm@posti.FMI.FI> 
 *                           (was hurtta+elm@ozone.FMI.FI)
 ******************************************************************************
 *  The Elm Mail System 
 *
 *			Copyright (c) 1988-1992 USENET Community Trust
 *			Copyright (c) 1986,1987 Dave Taylor
 *****************************************************************************/

/** compare strings ignoring case - length limited
**/

#include "headers.h"

/* Is this needed? This is same than strncasecmp 
 *        - K E H <hurtta@ozone.FMI.FI>
 */

int strincmp(s1,s2,n)
     CONST char *s1, *s2;
     int n;
{
	/* case insensitive comparison */
	int d;
	while (--n >= 0) {
#ifdef ASCII_CTYPE
	  if (!isascii(*s1) || !isascii(*s2))
	    d = *s1 - *s2;
	  else
#endif
	    d = (tolower((unsigned char)*s1) - tolower((unsigned char)*s2));
	  if ( d != 0 || *s1 == '\0' || *s2 == '\0' )
	    return d;
	  ++s1;
	  ++s2;
	}
	return(0);
}

/*
 * Local Variables:
 *  mode:c
 *  c-basic-offset:4
 *  buffer-file-coding-system: iso-8859-1
 * End:
 */



syntax highlighted by Code2HTML, v. 0.9.1