From 8a7b707f6f841655498c753701ee38f12ba630cf Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 27 May 2014 20:35:49 -0700 Subject: Replace uStrCaseCmp() with direct calls to strcasecmp() strcasecmp is available in Unix98 and later, so part of the X.Org base platform requirements. Signed-off-by: Alan Coopersmith --- utils.c | 31 ------------------------------- utils.h | 8 +------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/utils.c b/utils.c index 2243c32..7223a62 100644 --- a/utils.c +++ b/utils.c @@ -144,34 +144,3 @@ uInternalError(const char *s, ...) va_end(ap); return; } - -/***====================================================================***/ - -#ifndef HAVE_STRCASECMP -int -uStrCaseCmp(const char *str1, const char *str2) -{ - char buf1[512], buf2[512]; - char c, *s; - - register int n; - - for (n = 0, s = buf1; (c = *str1++); n++) { - if (isupper(c)) - c = tolower(c); - if (n > 510) - break; - *s++ = c; - } - *s = '\0'; - for (n = 0, s = buf2; (c = *str2++); n++) { - if (isupper(c)) - c = tolower(c); - if (n > 510) - break; - *s++ = c; - } - *s = '\0'; - return (strcmp(buf1, buf2)); -} -#endif diff --git a/utils.h b/utils.h index cbb55f9..a30f782 100644 --- a/utils.h +++ b/utils.h @@ -92,13 +92,7 @@ extern void uInternalError(const char *s, ...); #define uStringEqual(s1,s2) (uStringCompare(s1,s2)==Equal) #define uStringPrefix(p,s) (strncmp(p,s,strlen(p))==0) #define uStringCompare(s1,s2) (strcmp(s1,s2)) -#define uStrCaseEqual(s1,s2) (uStrCaseCmp(s1,s2)==0) -#ifdef HAVE_STRCASECMP -#define uStrCaseCmp(s1,s2) (strcasecmp(s1,s2)) -#else -extern int uStrCaseCmp(const char * /* s1 */ , - const char * /* s2 */); -#endif +#define uStrCaseEqual(s1,s2) (strcasecmp(s1,s2)==0) /***====================================================================***/ -- cgit v1.2.3