From 1b6d162e8339edb02dc76c6712d9d7a8804b2748 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 16 Sep 2014 19:04:19 +0200 Subject: [PATCH] Ignore color arguments not starting with # Old settings files from xpm-using version might still contain color designations like 'white' or 'red'. Since Cairo would interpret these as black, it is better to ignore them, so the default color is used. --- gtk/xboard.c | 2 +- xaw/xboard.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/xboard.c b/gtk/xboard.c index 895e10f..4daec27 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -447,7 +447,7 @@ CreateFonts () void ParseColor (int n, char *name) { // in XBoard, just copy the color-name string - if(colorVariable[n]) *(char**)colorVariable[n] = strdup(name); + if(colorVariable[n] && *name == '#') *(char**)colorVariable[n] = strdup(name); } char * diff --git a/xaw/xboard.c b/xaw/xboard.c index 86d4283..b9fb0e1 100644 --- a/xaw/xboard.c +++ b/xaw/xboard.c @@ -536,7 +536,7 @@ CreateFonts () void ParseColor (int n, char *name) { // in XBoard, just copy the color-name string - if(colorVariable[n]) *(char**)colorVariable[n] = strdup(name); + if(colorVariable[n] && *name == '#') *(char**)colorVariable[n] = strdup(name); } char * -- 1.7.0.4