diff options
author | Jie Luo <clotho67@gmail.com> | 2008-07-17 10:22:29 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2008-07-17 10:22:29 -0400 |
commit | 5d11ae7a69e3a7611c667be4628a15a4b514f72c (patch) | |
tree | 25e790e3fa75e04439778130c60ccad6f9922f5b | |
parent | 478d3918d5b23fba1a7e3aaea766dfa785e5a0a6 (diff) |
Fix color lookup.
OsStrCaseCmp returned inverted comparison sense from normal strcasecmp.
-rw-r--r-- | os/oscolor.c | 7 |
1 files 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; |