X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Fstrcasecmp.c;fp=common-src%2Fstrcasecmp.c;h=ac5f79f0948607ea52230906bf56edb202d59750;hb=12179dea039515c06168c0037d048566a3f623de;hp=b3dd1fab85951b0ce7e95c88265ce60837f6a305;hpb=94c03cae686e4196a345d72452fda2a5203768ce;p=debian%2Famanda diff --git a/common-src/strcasecmp.c b/common-src/strcasecmp.c index b3dd1fa..ac5f79f 100644 --- a/common-src/strcasecmp.c +++ b/common-src/strcasecmp.c @@ -1,21 +1,13 @@ /* Provided by Michael Schmitz ; public domain? */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) -#include -#else -#include -#endif +#include "amanda.h" /* Compare S1 and S2 ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. */ int -strcasecmp(s1, s2) - const char *s1; - const char *s2; +strcasecmp( + const char *s1, + const char *s2) { register const unsigned char *p1 = (const unsigned char *) s1; register const unsigned char *p2 = (const unsigned char *) s2; @@ -24,11 +16,10 @@ strcasecmp(s1, s2) if (p1 == p2) return 0; - do - { + do { c1 = tolower (*p1++); c2 = tolower (*p2++); if (c1 == '\0' || c2 == '\0' || c1 != c2) return c1 - c2; - } while ( 1 == 1 ); + } while ( 1 == 1 ); }