From 5d11ae7a69e3a7611c667be4628a15a4b514f72c Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Thu, 17 Jul 2008 10:22:29 -0400 Subject: [PATCH] Fix color lookup. OsStrCaseCmp returned inverted comparison sense from normal strcasecmp. --- os/oscolor.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/os/oscolor.c b/os/oscolor.c index 10dc2ba80..cc45aafb1 100644 --- a/os/oscolor.c +++ b/os/oscolor.c @@ -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;