diff options
Diffstat (limited to 'libguile/read.c')
-rw-r--r-- | libguile/read.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/read.c b/libguile/read.c index a4357d179..bc5c3c179 100644 --- a/libguile/read.c +++ b/libguile/read.c @@ -2074,11 +2074,11 @@ scm_i_scan_for_encoding (SCM port) pt->rw_active = SCM_PORT_READ; } - if (buf->cur == buf->end) + if (scm_port_buffer_can_take (buf) == 0) { /* We can use the read buffer, and thus avoid a seek. */ buf = scm_fill_input_unlocked (port); - bytes_read = buf->end - buf->cur; + bytes_read = scm_port_buffer_can_take (buf); if (bytes_read > SCM_ENCODING_SEARCH_SIZE) bytes_read = SCM_ENCODING_SEARCH_SIZE; |