]> git.eshelyaron.com Git - emacs.git/commitdiff
(read1): Handle read_escape making a multibyte character.
authorRichard M. Stallman <rms@gnu.org>
Sat, 9 Aug 1997 03:44:54 +0000 (03:44 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 9 Aug 1997 03:44:54 +0000 (03:44 +0000)
src/lread.c

index e6cc2b7b074e0ad0c7032f3f31db9ae2a3a4cba1..8718a05c9d43921db969a76d0cf27d88e06b9516 100644 (file)
@@ -1620,7 +1620,29 @@ read1 (readcharfun, pch, first_in_list)
                end = read_buffer + read_buffer_size;
              }
            if (c == '\\')
-             c = read_escape (readcharfun);
+             {
+               c = read_escape (readcharfun);
+               if (! SINGLE_BYTE_CHAR_P ((c & ~CHAR_META)))
+                 {
+                   char workbuf[4];
+                   char *str = workbuf;
+                   int length;
+
+                   length = non_ascii_char_to_string (c, workbuf, &str);
+
+                   if (p + length > end)
+                     {
+                       char *new = (char *) xrealloc (read_buffer, read_buffer_size *= 2);
+                       p += new - read_buffer;
+                       read_buffer += new - read_buffer;
+                       end = read_buffer + read_buffer_size;
+                     }
+                   bcopy (str, p, length);
+                   p += length;
+                   continue;
+                 }
+             }
            /* c is -1 if \ newline has just been seen */
            if (c == -1)
              {