summaryrefslogtreecommitdiff
path: root/src/lread.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-10-11 21:58:43 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-10-11 21:58:43 -0700
commit0324f3af3dddd189617a9cc4b203e3783e96fc7a (patch)
treef4f8512bdb6a8e5566e82bf8049f738594986216 /src/lread.c
parent7359a765382ff00442f08d1435fd5ededbe10283 (diff)
downloademacs-0324f3af3dddd189617a9cc4b203e3783e96fc7a.tar.gz
* lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
Some packages use them to denote characters with modifiers.
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c6
1 files changed, 4 insertions, 2 deletions
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;
}