From 32a72bb6313c177084c1fdba2ea9506947ae9f35 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Sat, 4 Mar 2000 05:07:14 +0000 Subject: Fri Mar 3 21:05:11 PST 2000 Michael Jennings Tom Gilbert spotted a fallback issue with colors which I have now fixed. Tom, your e-mail address is too damned long. Just thought you should know. SVN revision: 2181 --- src/windows.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/windows.c') diff --git a/src/windows.c b/src/windows.c index 7042738..74ff633 100644 --- a/src/windows.c +++ b/src/windows.c @@ -160,6 +160,13 @@ get_color_by_name(const char *name, const char *fallback) { XColor xcol; + if (name == NULL) { + if (fallback == NULL) { + return ((Pixel) -1); + } else { + name = fallback; + } + } if (!XParseColor(Xdisplay, cmap, name, &xcol)) { print_warning("Unable to resolve \"%s\" as a color name. Falling back on \"%s\".", name, NONULL(fallback)); name = fallback; @@ -242,7 +249,7 @@ process_colors(void) Pixel pixel; for (i = 0; i < NRS_COLORS; i++) { - if ((Xdepth <= 2) || (!rs_color[i]) || ((pixel = get_color_by_name(rs_color[i], def_colorName[i])) == (Pixel) -1)) { + if ((Xdepth <= 2) || ((pixel = get_color_by_name(rs_color[i], def_colorName[i])) == (Pixel) -1)) { switch (i) { case fgColor: pixel = WhitePixel(Xdisplay, Xscreen); -- cgit v1.2.1