mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
* read.c (scm_read): Don't assume that scm_cur_inp is always open.
* ports.c (scm_read_char): Same. * ioext.c (scm_read_line): Same. (Thanks to Bernard Urban.)
This commit is contained in:
parent
920ffdaa76
commit
4cc81ec6ca
3 changed files with 8 additions and 13 deletions
|
@ -245,11 +245,8 @@ scm_read_line (port)
|
|||
|
||||
if (SCM_UNBNDP (port))
|
||||
port = scm_cur_inp;
|
||||
else
|
||||
{
|
||||
SCM_ASSERT (SCM_NIMP (port) && SCM_OPINPORTP (port),
|
||||
port, SCM_ARG1, s_read_line);
|
||||
}
|
||||
SCM_ASSERT (SCM_NIMP (port) && SCM_OPINPORTP (port),
|
||||
port, SCM_ARG1, s_read_line);
|
||||
|
||||
pt = SCM_PTAB_ENTRY (port);
|
||||
if (pt->rw_active == SCM_PORT_WRITE)
|
||||
|
|
|
@ -669,8 +669,7 @@ scm_read_char (SCM port)
|
|||
int c;
|
||||
if (SCM_UNBNDP (port))
|
||||
port = scm_cur_inp;
|
||||
else
|
||||
SCM_ASSERT (SCM_NIMP (port) && SCM_OPINPORTP (port), port, SCM_ARG1, s_read_char);
|
||||
SCM_ASSERT (SCM_NIMP (port) && SCM_OPINPORTP (port), port, SCM_ARG1, s_read_char);
|
||||
c = scm_getc (port);
|
||||
if (EOF == c)
|
||||
return SCM_EOF_VAL;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995,1996,1997, 1999 Free Software Foundation, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -98,11 +98,10 @@ scm_read (port)
|
|||
|
||||
if (SCM_UNBNDP (port))
|
||||
port = scm_cur_inp;
|
||||
else
|
||||
SCM_ASSERT (SCM_NIMP (port) && SCM_OPINPORTP (port),
|
||||
port,
|
||||
SCM_ARG1,
|
||||
s_read);
|
||||
SCM_ASSERT (SCM_NIMP (port) && SCM_OPINPORTP (port),
|
||||
port,
|
||||
SCM_ARG1,
|
||||
s_read);
|
||||
|
||||
c = scm_flush_ws (port, (char *) NULL);
|
||||
if (EOF == c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue