Skip to content

Commit

Permalink
Fixed bug 1698 - XPM colors can be in upper case and/or lower case
Browse files Browse the repository at this point in the history
Sylvain

Due to previous commits, there is a regression : some xpm does not load because
of color name not found.

You called "toupper" before, and now only using "SDL_strncmp" to look for xpm
color name.

In a xpm file, colors can be in Lower and/or Upper case !
So, we need to call "SDL_strncasecmp".
  • Loading branch information
slouken committed Feb 8, 2013
1 parent 0fe7b05 commit 04f64d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IMG_xpm.c
Expand Up @@ -888,7 +888,7 @@ static int color_to_rgb(char *spec, int speclen, Uint32 *rgb)
} else {
int i;
for(i = 0; i < SDL_arraysize(known); i++)
if(SDL_strncmp(known[i].name, spec, speclen) == 0) {
if(SDL_strncasecmp(known[i].name, spec, speclen) == 0) {
*rgb = known[i].rgb;
return 1;
}
Expand Down

0 comments on commit 04f64d2

Please sign in to comment.