Skip to content

Commit

Permalink
Bug #3819: Remove open-coding of strcasecmp.
Browse files Browse the repository at this point in the history
  • Loading branch information
fooishbar committed Mar 25, 2006
1 parent b3570dd commit d7b9e2b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 32 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
prototype to xkb.h.
Explicitly initialise nTypes in xkb.c.

* xkb/xkbfmisc.c:
* xkb/maprules.c:
Bug #3819: Remove open-coding of strcasecmp.

2006-03-25 Adam Jackson <ajax@freedesktop.org>

* hw/xfree86/common/xf86Bus.c:
Expand Down
8 changes: 4 additions & 4 deletions xkb/maprules.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,13 +1106,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 (!_XkbStrCaseCmp(tok,"model"))
if (strcmp(tolower(tok),"model") == 0)
headingtype = HEAD_MODEL;
else if (!_XkbStrCaseCmp(tok,"layout"))
else if (strcmp(tolower(tok),"layout") == 0)
headingtype = HEAD_LAYOUT;
else if (!_XkbStrCaseCmp(tok,"variant"))
else if (strcmp(tolower(tok),"variant") == 0)
headingtype = HEAD_VARIANT;
else if (!_XkbStrCaseCmp(tok,"option"))
else if (strcmp(tolower(tok),"option") == 0)
headingtype = HEAD_OPTION;
else {
int i;
Expand Down
28 changes: 0 additions & 28 deletions xkb/xkbfmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,34 +150,6 @@ unsigned set,rtrn;

/***===================================================================***/

int
_XkbStrCaseCmp(char *str1,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));
}

/***===================================================================***/

Bool
XkbLookupGroupAndLevel( XkbDescPtr xkb,
int key,
Expand Down

0 comments on commit d7b9e2b

Please sign in to comment.