diff options
author | Daniel Stone <daniel@fooishbar.org> | 2006-03-27 22:28:32 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2006-03-27 22:28:32 +0000 |
commit | 5be8a66d324f3d5840b134ad29069eace64e6f12 (patch) | |
tree | 23f328fd517ab2c55e09b484912390b58dfdae70 /xkb | |
parent | 9e202dfe40e2bdd66f461a6ba531e927f82096ae (diff) |
Fix remnants of previous busted _XkbStrCaseCmp commit.
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/maprules.c | 14 | ||||
-rw-r--r-- | xkb/xkbfmisc.c | 16 |
2 files changed, 26 insertions, 4 deletions
diff --git a/xkb/maprules.c b/xkb/maprules.c index 6ab8e26eb..517b79d25 100644 --- a/xkb/maprules.c +++ b/xkb/maprules.c @@ -82,6 +82,12 @@ #define PR_DEBUG2(s,a,b) #endif +#ifdef NEED_STRCASECMP +extern int _XkbStrCaseCmp(char *s1, char *s2); +#else +#define _XkbStrCaseCmp strcasecmp +#endif + /***====================================================================***/ #define DFLT_LINE_SIZE 128 @@ -1106,13 +1112,13 @@ int len,headingtype,extra_ndx = 0; for ( ; GetInputLine(file,&line,False); line.num_line= 0) { if (line.line[0]=='!') { tok = strtok(&(line.line[1]), " \t"); - if (strcmp(tolower(tok),"model") == 0) + if (_XkbStrCaseCmp(tolower(tok),"model") == 0) headingtype = HEAD_MODEL; - else if (strcmp(tolower(tok),"layout") == 0) + else if (_XkbStrCaseCmp(tok,"layout") == 0) headingtype = HEAD_LAYOUT; - else if (strcmp(tolower(tok),"variant") == 0) + else if (_XkbStrCaseCmp(tok,"variant") == 0) headingtype = HEAD_VARIANT; - else if (strcmp(tolower(tok),"option") == 0) + else if (_XkbStrCaseCmp(tok,"option") == 0) headingtype = HEAD_OPTION; else { int i; diff --git a/xkb/xkbfmisc.c b/xkb/xkbfmisc.c index 01f6174aa..0ef485aa1 100644 --- a/xkb/xkbfmisc.c +++ b/xkb/xkbfmisc.c @@ -659,3 +659,19 @@ XkbNameMatchesPattern(char *name,char *ptrn) /* if we get here, the pattern is exhausted (-:just like me:-) */ return (name[0]=='\0'); } + +#ifdef NEED_STRCASECMP +_X_HIDDEN int +_XkbStrCaseCmp(char *str1,char *str2) +{ + const u_char *us1 = (const u_char *)str1, *us2 = (const u_char *)str2; + + while (tolower(*us1) == tolower(*us2)) { + if (*us1++ == '\0') + return (0); + us2++; + } + + return (tolower(*us1) - tolower(*us2)); +} +#endif |