diff options
author | Michael Jennings <mej@kainx.org> | 2000-03-04 05:07:14 +0000 |
---|---|---|
committer | Michael Jennings <mej@kainx.org> | 2000-03-04 05:07:14 +0000 |
commit | 32a72bb6313c177084c1fdba2ea9506947ae9f35 (patch) | |
tree | 3e7675a33f4f397a7d7ea1961ca0683af343ea85 /src/windows.c | |
parent | 2234e70dd927a6d2a469e0861015a1820c3f6728 (diff) | |
download | eterm-32a72bb6313c177084c1fdba2ea9506947ae9f35.tar.gz |
Fri Mar 3 21:05:11 PST 2000 Michael Jennings <mej@eterm.org>
Tom Gilbert <gilbertt@tomgilbert.freeserve.co.uk> 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
Diffstat (limited to 'src/windows.c')
-rw-r--r-- | src/windows.c | 9 |
1 files changed, 8 insertions, 1 deletions
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); |