mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 14:21:10 +02:00
* Fixed readline default input/output port parameter handling.
* Removed redundant SCM_N?IMP tests.
This commit is contained in:
parent
08b5e6c316
commit
379b35daaa
2 changed files with 20 additions and 9 deletions
|
@ -1,3 +1,14 @@
|
||||||
|
2000-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
* readline.c (current_input_getc): Use more explicit predicate
|
||||||
|
than SCM_NIMP.
|
||||||
|
|
||||||
|
(scm_readline, scm_readline_init_ports, completion_function):
|
||||||
|
Remove redundant SCM_N?IMP tests.
|
||||||
|
|
||||||
|
(scm_readline): Fixed default input/output port parameter
|
||||||
|
handling.
|
||||||
|
|
||||||
2000-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
2000-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
* readline.c (scm_readline, scm_add_history, completion_function,
|
* readline.c (scm_readline, scm_add_history, completion_function,
|
||||||
|
|
|
@ -129,7 +129,7 @@ static SCM before_read;
|
||||||
static int
|
static int
|
||||||
current_input_getc (FILE *in)
|
current_input_getc (FILE *in)
|
||||||
{
|
{
|
||||||
if (promptp && SCM_NIMP (before_read))
|
if (promptp && !SCM_FALSEP (before_read))
|
||||||
{
|
{
|
||||||
scm_apply (before_read, SCM_EOL, SCM_EOL);
|
scm_apply (before_read, SCM_EOL, SCM_EOL);
|
||||||
promptp = 0;
|
promptp = 0;
|
||||||
|
@ -167,7 +167,7 @@ SCM_DEFINE (scm_readline, "%readline", 0, 4, 0,
|
||||||
|
|
||||||
if (!SCM_UNBNDP (text))
|
if (!SCM_UNBNDP (text))
|
||||||
{
|
{
|
||||||
if (!(SCM_NIMP (text) && SCM_STRINGP (text)))
|
if (!SCM_STRINGP (text))
|
||||||
{
|
{
|
||||||
--in_readline;
|
--in_readline;
|
||||||
scm_wrong_type_arg (s_scm_readline, SCM_ARG1, text);
|
scm_wrong_type_arg (s_scm_readline, SCM_ARG1, text);
|
||||||
|
@ -175,8 +175,8 @@ SCM_DEFINE (scm_readline, "%readline", 0, 4, 0,
|
||||||
SCM_STRING_COERCE_0TERMINATION_X (text);
|
SCM_STRING_COERCE_0TERMINATION_X (text);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!((SCM_UNBNDP (inp) && SCM_NIMP (scm_cur_inp) && SCM_OPINFPORTP (inp))
|
if (!((SCM_UNBNDP (inp) && SCM_OPINFPORTP (scm_cur_inp))
|
||||||
|| (SCM_NIMP (inp) && SCM_OPINFPORTP (inp))))
|
|| SCM_OPINFPORTP (inp)))
|
||||||
{
|
{
|
||||||
--in_readline;
|
--in_readline;
|
||||||
scm_misc_error (s_scm_readline,
|
scm_misc_error (s_scm_readline,
|
||||||
|
@ -184,8 +184,8 @@ SCM_DEFINE (scm_readline, "%readline", 0, 4, 0,
|
||||||
SCM_EOL);
|
SCM_EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!((SCM_UNBNDP (outp) && SCM_NIMP (scm_cur_outp) && SCM_OPINFPORTP (outp))
|
if (!((SCM_UNBNDP (outp) && SCM_OPINFPORTP (scm_cur_outp))
|
||||||
|| (SCM_NIMP (outp) && SCM_OPOUTFPORTP (outp))))
|
|| SCM_OPOUTFPORTP (outp)))
|
||||||
{
|
{
|
||||||
--in_readline;
|
--in_readline;
|
||||||
scm_misc_error (s_scm_readline,
|
scm_misc_error (s_scm_readline,
|
||||||
|
@ -302,13 +302,13 @@ scm_readline_init_ports (SCM inp, SCM outp)
|
||||||
if (SCM_UNBNDP (outp))
|
if (SCM_UNBNDP (outp))
|
||||||
outp = scm_cur_outp;
|
outp = scm_cur_outp;
|
||||||
|
|
||||||
if (!(SCM_NIMP (inp) && SCM_OPINFPORTP (inp))) {
|
if (!SCM_OPINFPORTP (inp)) {
|
||||||
scm_misc_error (0,
|
scm_misc_error (0,
|
||||||
"Input port is not open or not a file port",
|
"Input port is not open or not a file port",
|
||||||
SCM_EOL);
|
SCM_EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(SCM_NIMP (outp) && SCM_OPOUTFPORTP (outp))) {
|
if (!SCM_OPOUTFPORTP (outp)) {
|
||||||
scm_misc_error (0,
|
scm_misc_error (0,
|
||||||
"Output port is not open or not a file port",
|
"Output port is not open or not a file port",
|
||||||
SCM_EOL);
|
SCM_EOL);
|
||||||
|
@ -400,7 +400,7 @@ completion_function (char *text, int continuep)
|
||||||
if (SCM_FALSEP (res))
|
if (SCM_FALSEP (res))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!(SCM_NIMP (res) && SCM_STRINGP (res)))
|
if (!SCM_STRINGP (res))
|
||||||
scm_misc_error (s_scm_readline,
|
scm_misc_error (s_scm_readline,
|
||||||
"Completion function returned bogus value: %S",
|
"Completion function returned bogus value: %S",
|
||||||
SCM_LIST1 (res));
|
SCM_LIST1 (res));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue