changeset 4484:d6e2e2e819d7

Merge.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 26 Jul 2008 09:52:06 +0200
parents e3ef34f57070 (current diff) 7869173584fc (diff)
children 57db42ba54fb
files src/ChangeLog
diffstat 2 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Jul 26 09:37:08 2008 +0200
+++ b/src/ChangeLog	Sat Jul 26 09:52:06 2008 +0200
@@ -4,6 +4,12 @@
 	Don't set window-system to 'stream if running noninteractively,
 	revert to the documented behaviour. 
 
+2008-07-16  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* lread.c (read_escape): 
+	Error if we're handed an over-long hex character escape, something
+	which arises reasonably frequently in code written for GNU. 
+
 2008-07-07  Aidan Kehoe  <kehoea@parhasard.net>
 
 	Patch to make it up to the device-specific code whether
--- a/src/lread.c	Sat Jul 26 09:37:08 2008 +0200
+++ b/src/lread.c	Sat Jul 26 09:52:06 2008 +0200
@@ -1855,6 +1855,28 @@
 		break;
 	      }
 	  }
+
+        if (count == 3)
+          {
+            c = readchar (readcharfun);
+            if ((c >= '0' && c <= '9') ||
+                (c >= 'a' && c <= 'f') ||
+                (c >= 'A' && c <= 'F'))
+              {
+                Lisp_Object args[2];
+
+                if      (c >= '0' && c <= '9')  i = (i << 4) + (c - '0');
+                else if (c >= 'a' && c <= 'f')  i = (i << 4) + (c - 'a') + 10;
+                else if (c >= 'A' && c <= 'F')  i = (i << 4) + (c - 'A') + 10;
+
+                args[0] = build_string ("?\\x%x");
+                args[1] = make_int (i);
+                syntax_error ("Overlong hex character escape",
+                              Fformat (2, args));
+              }
+            unreadchar (readcharfun, c);
+          }
+
 	return i;
       }
     case 'U':