diff options
| author | Lars Ingebrigtsen | 2019-08-23 06:20:41 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-08-23 06:20:41 +0200 |
| commit | fbbc257190d115dc76e1a8cf4e4992d52d7f55b9 (patch) | |
| tree | 4117327c4dbe9dab741175f929066718ef51584d | |
| parent | e7d3ddf689300bdcccbd1762cf3387ceb17505a1 (diff) | |
| download | emacs-fbbc257190d115dc76e1a8cf4e4992d52d7f55b9.tar.gz emacs-fbbc257190d115dc76e1a8cf4e4992d52d7f55b9.zip | |
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).
| -rw-r--r-- | src/lread.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lread.c b/src/lread.c index e444830c99a..6ae7a0d8ba0 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -2585,7 +2585,8 @@ read_escape (Lisp_Object readcharfun, bool stringp) | |||
| 2585 | want. */ | 2585 | want. */ |
| 2586 | int digit = char_hexdigit (c); | 2586 | int digit = char_hexdigit (c); |
| 2587 | if (digit < 0) | 2587 | if (digit < 0) |
| 2588 | error ("Non-hex digit used for Unicode escape"); | 2588 | error ("Non-hex character used for Unicode escape: %c (%d)", |
| 2589 | c, c); | ||
| 2589 | i = (i << 4) + digit; | 2590 | i = (i << 4) + digit; |
| 2590 | } | 2591 | } |
| 2591 | if (i > 0x10FFFF) | 2592 | if (i > 0x10FFFF) |