emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 64e25cd: More robust NS hex colour string parsing


From: Eli Zaretskii
Subject: Re: master 64e25cd: More robust NS hex colour string parsing
Date: Fri, 12 Jun 2020 22:25:14 +0300

> Date: Fri, 12 Jun 2020 22:11:10 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: pipcet@gmail.com, emacs-devel@gnu.org
> 
> The error checking aside, are the return values of the original code
> the same as of the proposed unified code?  If not, which of the 4
> current versions differ, and how?

Also, the return value in case of error seems to change the
externally-visible behavior:

> +If STRING is not in one of the above forms, return nil.  */)
> +  (Lisp_Object string)
> +{
> +  unsigned short r, g, b;
> +  return (parse_color_spec (SSDATA (string), &r, &g, &b)
> +          ? list3i (r, g, b)
> +          : Qnil);
> +}

At least tty-color-standard-values seems to never return nil for an
RGB spec, but now it will, right?  Can its callers cope with such a
return value?

And I wonder how the other callers of parse_color_spec will behave if
it detects an error and returns false.  Did you audit the code of the
callers to see if this could cause trouble?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]