1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-10 05:30:45 -08:00

Give a better error message when reading invalid "\unicode" escapes.

* src/lread.c (read_escape): Give a clearer error message on
Unicode escape sequences (bug#36988).
This commit is contained in:
Lars Ingebrigtsen 2019-08-23 06:20:41 +02:00
parent e7d3ddf689
commit fbbc257190

View file

@ -2585,7 +2585,8 @@ read_escape (Lisp_Object readcharfun, bool stringp)
want. */
int digit = char_hexdigit (c);
if (digit < 0)
error ("Non-hex digit used for Unicode escape");
error ("Non-hex character used for Unicode escape: %c (%d)",
c, c);
i = (i << 4) + digit;
}
if (i > 0x10FFFF)