mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
os: oscolor: fix BuiltinColor field naming
The "name" field doesn't actually hold the color's name, but instead the
offset of the name in the string table block. Thus, fix the field's name
to reflect this.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1313>
(cherry picked from commit 7a010beefe)
This commit is contained in:
committed by
Alan Coopersmith
parent
2ff89444b7
commit
a24bad63f0
@@ -56,7 +56,7 @@ typedef struct _builtinColor {
|
||||
unsigned char red;
|
||||
unsigned char green;
|
||||
unsigned char blue;
|
||||
unsigned short name;
|
||||
unsigned short name_offs;
|
||||
} BuiltinColor;
|
||||
|
||||
static const char BuiltinColorNames[] = {
|
||||
@@ -1645,8 +1645,8 @@ OsLookupColor(int screen,
|
||||
while (high >= low) {
|
||||
mid = (low + high) / 2;
|
||||
c = &BuiltinColors[mid];
|
||||
r = strncasecmp(&BuiltinColorNames[c->name], name, len);
|
||||
if (r == 0 && len == strlen(&BuiltinColorNames[c->name])) {
|
||||
r = strncasecmp(&BuiltinColorNames[c->name_offs], name, len);
|
||||
if (r == 0 && len == strlen(&BuiltinColorNames[c->name_offs])) {
|
||||
*pred = c->red * 0x101;
|
||||
*pgreen = c->green * 0x101;
|
||||
*pblue = c->blue * 0x101;
|
||||
|
||||
Reference in New Issue
Block a user