1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

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.
This commit is contained in:
Mark H Weaver 2018-08-02 10:05:17 -04:00
parent 71f536c3d8
commit 4c91de3e45

View file

@ -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