comparison src/lread.c @ 19240:c962562027d4

(read1): Handle read_escape making a multibyte character.
author Richard M. Stallman <rms@gnu.org>
date Sat, 09 Aug 1997 03:44:54 +0000
parents 266915689f9e
children be0876941b71
comparison
equal deleted inserted replaced
19239:8298b8a6a47d 19240:c962562027d4
1618 p += new - read_buffer; 1618 p += new - read_buffer;
1619 read_buffer += new - read_buffer; 1619 read_buffer += new - read_buffer;
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 {
1627 if (p == read_buffer) 1649 if (p == read_buffer)
1628 cancel = 1; 1650 cancel = 1;