diff options
author | Mark H Weaver <mhw@netris.org> | 2014-03-19 23:36:46 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2014-03-19 23:36:46 -0400 |
commit | 5dcbcfcef8eefd1f9e57d8ba69efe1ca945c95b1 (patch) | |
tree | 0c8ee97a95c27359226e2265272673c316d41249 /module/rnrs | |
parent | e26ab067b2073c1eb5ace13d069674515b9f97c6 (diff) | |
download | guile-5dcbcfcef8eefd1f9e57d8ba69efe1ca945c95b1.tar.gz |
Fix (rnrs io simple) to open file ports in textual mode.
Fixes <http://bugs.gnu.org/17044>.
Reported and diagnosed by Xin Wang <dram.wang@gmail.com>.
* module/rnrs/io/simple.scm (open-input-file, open-output-file): Pass
missing buffer-mode argument to open-file-{input,output}-port.
Previously, (native-transcoder) was incorrectly passed as the
buffer-mode argument, so no transcoder was provided, thus creating a
binary port.
Diffstat (limited to 'module/rnrs')
-rw-r--r-- | module/rnrs/io/simple.scm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/module/rnrs/io/simple.scm b/module/rnrs/io/simple.scm index 031628b38..5eb396f0e 100644 --- a/module/rnrs/io/simple.scm +++ b/module/rnrs/io/simple.scm @@ -1,6 +1,6 @@ ;;; simple.scm --- The R6RS simple I/O library -;; Copyright (C) 2010, 2011 Free Software Foundation, Inc. +;; Copyright (C) 2010, 2011, 2014 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public @@ -91,6 +91,7 @@ eof-object eof-object? file-options + buffer-mode native-transcoder get-char lookahead-char @@ -131,10 +132,16 @@ (lambda (port) (with-output-to-port port thunk)))) (define (open-input-file filename) - (open-file-input-port filename (file-options) (native-transcoder))) + (open-file-input-port filename + (file-options) + (buffer-mode block) + (native-transcoder))) (define (open-output-file filename) - (open-file-output-port filename (file-options) (native-transcoder))) + (open-file-output-port filename + (file-options) + (buffer-mode block) + (native-transcoder))) (define close-input-port close-port) (define close-output-port close-port) |