Fix color lookup.

OsStrCaseCmp returned inverted comparison sense from normal strcasecmp.
This commit is contained in:
Jie Luo 2008-07-17 10:22:29 -04:00 committed by Adam Jackson
parent 478d3918d5
commit 5d11ae7a69

View File

@ -59,7 +59,7 @@ typedef struct _builtinColor {
unsigned short name;
} BuiltinColor;
static const unsigned char BuiltinColorNames[] = {
static const char BuiltinColorNames[] = {
"alice blue\0"
"AliceBlue\0"
"antique white\0"
@ -1573,14 +1573,13 @@ static const BuiltinColor BuiltinColors[] = {
Bool
OsLookupColor(int screen,
char *s_name,
char *name,
unsigned int len,
unsigned short *pred,
unsigned short *pgreen,
unsigned short *pblue)
{
const BuiltinColor *c;
unsigned char *name = (unsigned char *) s_name;
int low, mid, high;
int r;
@ -1598,7 +1597,7 @@ OsLookupColor(int screen,
*pblue = c->blue * 0x101;
return TRUE;
}
if (r < 0)
if (r > 0)
high = mid - 1;
else
low = mid + 1;