# HG changeset patch # User Richard M. Stallman # Date 871098294 0 # Node ID c962562027d49e93a86762d4563a58c7c53919a5 # Parent 8298b8a6a47d600442c38faa74118bd3550f5d36 (read1): Handle read_escape making a multibyte character. diff -r 8298b8a6a47d -r c962562027d4 src/lread.c --- a/src/lread.c Sat Aug 09 03:41:42 1997 +0000 +++ b/src/lread.c Sat Aug 09 03:44:54 1997 +0000 @@ -1620,7 +1620,29 @@ 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) {