diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-08-09 03:44:54 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-08-09 03:44:54 +0000 |
commit | 343ab3ce33de9698361a0a7ae1ba74d986abe390 (patch) | |
tree | 24a3d9c5bdfa681305e3e2a0fc7c28fc45f91200 /src | |
parent | c1f0079e0e7158a9e8365172565596561364c077 (diff) | |
download | emacs-343ab3ce33de9698361a0a7ae1ba74d986abe390.tar.gz |
(read1): Handle read_escape making a multibyte character.
Diffstat (limited to 'src')
-rw-r--r-- | src/lread.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/lread.c b/src/lread.c index e6cc2b7b074..8718a05c9d4 100644 --- a/src/lread.c +++ b/src/lread.c @@ -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) { |