diff options
| author | Richard M. Stallman | 1997-08-09 03:44:54 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-09 03:44:54 +0000 |
| commit | 03e88613889a536f59f74e22a41e585212d4f185 (patch) | |
| tree | 08f0b64f83113d63b808c26e1904d39a2809a33a /src | |
| parent | 4dc0f0fc0e5e9f4e80cd9a192ac854697bc49d46 (diff) | |
| download | emacs-03e88613889a536f59f74e22a41e585212d4f185.tar.gz emacs-03e88613889a536f59f74e22a41e585212d4f185.zip | |
(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) | |||
| 1620 | end = read_buffer + read_buffer_size; | 1620 | end = read_buffer + read_buffer_size; |
| 1621 | } | 1621 | } |
| 1622 | if (c == '\\') | 1622 | if (c == '\\') |
| 1623 | c = read_escape (readcharfun); | 1623 | { |
| 1624 | c = read_escape (readcharfun); | ||
| 1625 | if (! SINGLE_BYTE_CHAR_P ((c & ~CHAR_META))) | ||
| 1626 | { | ||
| 1627 | char workbuf[4]; | ||
| 1628 | char *str = workbuf; | ||
| 1629 | int length; | ||
| 1630 | |||
| 1631 | length = non_ascii_char_to_string (c, workbuf, &str); | ||
| 1632 | |||
| 1633 | if (p + length > end) | ||
| 1634 | { | ||
| 1635 | char *new = (char *) xrealloc (read_buffer, read_buffer_size *= 2); | ||
| 1636 | p += new - read_buffer; | ||
| 1637 | read_buffer += new - read_buffer; | ||
| 1638 | end = read_buffer + read_buffer_size; | ||
| 1639 | } | ||
| 1640 | |||
| 1641 | bcopy (str, p, length); | ||
| 1642 | p += length; | ||
| 1643 | continue; | ||
| 1644 | } | ||
| 1645 | } | ||
| 1624 | /* c is -1 if \ newline has just been seen */ | 1646 | /* c is -1 if \ newline has just been seen */ |
| 1625 | if (c == -1) | 1647 | if (c == -1) |
| 1626 | { | 1648 | { |