/*
**    Name: strcasecmp.c
**
**    Date: Thu Jan 10 14:36:36 2002
**
*/

#include <string.h>
#include <stdlib.h>
#include "csstring.h"
#include <ctype.h>

int csstrcasecmp(const char *s1,const char *s2)
    {
    int result = 0;

    while (*s1 != '\0' && *s2 != '\0')
        {
        result = toupper(*s1) - toupper(*s2);

        if (result != 0)
            {
            return result;
            }

        s1++;
        s2++;
        }

    if (*s1 != *s2)
        {
        return toupper(*s1) - toupper(*s2);
        }

    return result;
    }
