mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
* Make sure that only open file ports are used as readline ports.
This commit is contained in:
parent
efa40607b1
commit
c4a9b7bbd1
2 changed files with 23 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
2001-01-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* readline.scm (set-readline-input-port!,
|
||||
set-readline-output-port!): Make sure that only valid port
|
||||
parameters are passed. Thanks to Martin Grabmueller for sending
|
||||
a patch that formed the basis for this change.
|
||||
|
||||
2001-01-18 Neil Jerram <neil@ossau.uklinux.net>
|
||||
|
||||
* readline.scm (make-readline-port): Make readline port
|
||||
|
|
|
@ -140,10 +140,24 @@
|
|||
(set! prompt2 (car rest))))
|
||||
|
||||
(define-public (set-readline-input-port! p)
|
||||
(set! input-port p))
|
||||
(cond ((or (not (file-port? p)) (not (input-port? p)))
|
||||
(scm-error 'wrong-type-arg "set-readline-input-port!"
|
||||
"Not a file input port: ~S" (list p) #f))
|
||||
((port-closed? p)
|
||||
(scm-error 'misc-error "set-readline-input-port!"
|
||||
"Port not open: ~S" (list p) #f))
|
||||
(else
|
||||
(set! input-port p))))
|
||||
|
||||
(define-public (set-readline-output-port! p)
|
||||
(set! output-port p))
|
||||
(cond ((or (not (file-port? p)) (not (output-port? p)))
|
||||
(scm-error 'wrong-type-arg "set-readline-input-port!"
|
||||
"Not a file output port: ~S" (list p) #f))
|
||||
((port-closed? p)
|
||||
(scm-error 'misc-error "set-readline-output-port!"
|
||||
"Port not open: ~S" (list p) #f))
|
||||
(else
|
||||
(set! output-port p))))
|
||||
|
||||
(define-public (set-readline-read-hook! h)
|
||||
(set! read-hook h))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue