mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-29 16:30:19 +02:00
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.
This commit is contained in:
parent
e26ab067b2
commit
5dcbcfcef8
1 changed files with 10 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
;;; simple.scm --- The R6RS simple I/O library
|
;;; 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
|
;; This library is free software; you can redistribute it and/or
|
||||||
;; modify it under the terms of the GNU Lesser General Public
|
;; modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -91,6 +91,7 @@
|
||||||
eof-object
|
eof-object
|
||||||
eof-object?
|
eof-object?
|
||||||
file-options
|
file-options
|
||||||
|
buffer-mode
|
||||||
native-transcoder
|
native-transcoder
|
||||||
get-char
|
get-char
|
||||||
lookahead-char
|
lookahead-char
|
||||||
|
@ -131,10 +132,16 @@
|
||||||
(lambda (port) (with-output-to-port port thunk))))
|
(lambda (port) (with-output-to-port port thunk))))
|
||||||
|
|
||||||
(define (open-input-file filename)
|
(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)
|
(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-input-port close-port)
|
||||||
(define close-output-port close-port)
|
(define close-output-port close-port)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue