1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 21:40:33 +02:00

'scm_c_read' goes through the fast path with ISO-8859-1 unbuffered ports.

Discussed in <http://bugs.gnu.org/15368>.

* libguile/ports.c (scm_c_read): Enter the 'swap_buffer' case when
  pt->encoding is "ISO-8859-1".
This commit is contained in:
Ludovic Courtès 2013-10-14 22:24:48 +02:00
parent d360671c1c
commit c61be45084

View file

@ -1657,7 +1657,9 @@ scm_c_read (SCM port, void *buffer, size_t size)
requested number of bytes. (Note that a single scm_i_fill_input
call does not guarantee to fill the whole of the port's read
buffer.) */
if (pt->read_buf_size <= 1 && pt->encoding == NULL)
if (pt->read_buf_size <= 1 &&
(pt->encoding == NULL
|| c_strcasecmp (pt->encoding, "ISO-8859-1") == 0))
{
/* The port that we are reading from is unbuffered - i.e. does
not have its own persistent buffer - but we have a buffer,