summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-10-14 22:24:48 +0200
committerLudovic Courtès <ludo@gnu.org>2013-10-14 22:59:28 +0200
commitc61be45084d04b1db792b7e232f5bd77099f3287 (patch)
tree1c22eb6a6b5c8ff18182bbc42024b8165eb17b0c
parentd360671c1cca335600079f1c5714572d1c2e676d (diff)
downloadguile-c61be45084d04b1db792b7e232f5bd77099f3287.tar.gz
'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".
-rw-r--r--libguile/ports.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libguile/ports.c b/libguile/ports.c
index 9068c5cfa..6f219d6d2 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -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,