
/*
 *  STRING.C
 *
 *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
 *
 */

strcmpi(s, d)
char *s;
char *d;
{
    short c1, c2;
    for (;;) {
	c1 = *s++;
	c2 = *d++;

	if (c1 == 0 || c2 == 0)
	    return(c1 || c2);   /*  0= both are 0   */
	if (((c1 ^ c2) | 0x20) != 0x20)
	    return(1);
    }
    return(0);
}

strncmpi(s, d, n)
char *s;
char *d;
short n;
{
    short c1, c2;
    while (n--) {
	c1 = *s++;
	c2 = *d++;

	if (c1 == 0 || c2 == 0)
	    return(c1 || c2);   /*  0= both are 0   */
	if (((c1 ^ c2) | 0x20) != 0x20)
	    return(1);
    }
    return(0);
}

