From 0324f3af3dddd189617a9cc4b203e3783e96fc7a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 11 Oct 2011 21:58:43 -0700 Subject: [PATCH] * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff. Some packages use them to denote characters with modifiers. --- src/ChangeLog | 5 +++++ src/lread.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c24e70523f5..8ad59d5eb27 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-10-12 Paul Eggert + + * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff. + Some packages use them to denote characters with modifiers. + 2011-10-11 Andreas Schwab * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR) diff --git a/src/lread.c b/src/lread.c index af737d27070..110f3e62f71 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2210,7 +2210,7 @@ read_escape (Lisp_Object readcharfun, int stringp) case 'x': /* A hex escape, as in ANSI C. */ { - int i = 0; + unsigned int i = 0; int count = 0; while (1) { @@ -2234,7 +2234,9 @@ read_escape (Lisp_Object readcharfun, int stringp) UNREAD (c); break; } - if (MAX_CHAR < i) + /* Allow hex escapes as large as ?\xfffffff, because some + packages use them to denote characters with modifiers. */ + if ((CHAR_META | (CHAR_META - 1)) < i) error ("Hex character out of range: \\x%x...", i); count += count < 3; } -- 2.39.2