Commit 6c8e1d62 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

(Fcolor_distance): Don't continue checking a color for errors after it has been

correctly parsed as an RGB list.
parent 22bbca61
......@@ -5348,13 +5348,11 @@ If FRAME is unspecified or nil, the current frame is used. */)
CHECK_LIVE_FRAME (frame);
f = XFRAME (frame);
if ((CONSP (color1) && !parse_rgb_list (color1, &cdef1))
|| !STRINGP (color1)
|| !defined_color (f, SDATA (color1), &cdef1, 0))
if (!(CONSP (color1) && parse_rgb_list (color1, &cdef1))
&& !(STRINGP (color1) && defined_color (f, SDATA (color1), &cdef1, 0)))
signal_error ("Invalid color", color1);
if ((CONSP (color2) && !parse_rgb_list (color2, &cdef2))
|| !STRINGP (color2)
|| !defined_color (f, SDATA (color2), &cdef2, 0))
if (!(CONSP (color2) && parse_rgb_list (color2, &cdef2))
&& !(STRINGP (color2) && defined_color (f, SDATA (color2), &cdef2, 0)))
signal_error ("Invalid color", color2);
return make_number (color_distance (&cdef1, &cdef2));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment