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