# HG changeset patch # User Richard M. Stallman # Date 795549928 0 # Node ID 0a7048d331e62102f4e326c1b694757ecb56dea6 # Parent 43a05391e3e1712049ee105fa62b18672c89bbb5 (x_decode_color): Don't use cdef if defined_color failed. diff -r 43a05391e3e1 -r 0a7048d331e6 src/xfns.c --- a/src/xfns.c Sat Mar 18 07:14:50 1995 +0000 +++ b/src/xfns.c Sat Mar 18 18:05:28 1995 +0000 @@ -1069,11 +1069,13 @@ if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1) return def; - /* Ignore the return value of defined_color so that - we use a color close to the one requested - if we can't get the exact request. */ - defined_color (f, XSTRING (arg)->data, &cdef, 1); - return cdef.pixel; + /* defined_color is responsible for coping with failures + by looking for a near-miss. */ + if (defined_color (f, XSTRING (arg)->data, &cdef, 1)) + return cdef.pixel; + + /* defined_color failed; return an ultimate default. */ + return def; } /* Functions called only from `x_set_frame_param'