summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2018-08-02 10:05:17 -0400
committerAndy Wingo <wingo@pobox.com>2018-08-07 12:34:43 +0200
commit215617caea2aa0a25377d68a517cf8a75686b1c4 (patch)
treeec636035dc42590b7ddd8efe01cc831311500e52
parent9da7de45b628db4936b012b692a38b9af54cf3b9 (diff)
downloadguile-215617caea2aa0a25377d68a517cf8a75686b1c4.tar.gz
Fix R6RS call-with-{input,output}-file to open textual ports.
Fixes <https://bugs.gnu.org/32329>. Reported and diagnosed by Göran Weinholt <goran@weinholt.se>. * module/rnrs/io/simple.scm (call-with-input-file) (call-with-output-file): Use 'open-{input,output}-file' to open the port in textual mode. Previously 'open-file-{input,output}-port' was used, which opened the port in binary mode.
-rw-r--r--module/rnrs/io/simple.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/rnrs/io/simple.scm b/module/rnrs/io/simple.scm
index 5eb396f0e..0d778a9f9 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, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010, 2011, 2014, 2018 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
@@ -118,10 +118,10 @@
(define display (@@ (rnrs io ports) display))
(define (call-with-input-file filename proc)
- (call-with-port (open-file-input-port filename) proc))
+ (call-with-port (open-input-file filename) proc))
(define (call-with-output-file filename proc)
- (call-with-port (open-file-output-port filename) proc))
+ (call-with-port (open-output-file filename) proc))
(define (with-input-from-file filename thunk)
(call-with-input-file filename