summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>1999-08-24 02:11:17 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>1999-08-24 02:11:17 +0000
commit4a94d8ca0b57e93a75e870ff357019a4a0b1bfff (patch)
tree502a10c0496a66f425fbf74a46503d0d9911ac75
parent55d5475044a002f8d29465dccf427993f56a9ab4 (diff)
downloadguile-4a94d8ca0b57e93a75e870ff357019a4a0b1bfff.tar.gz
* ports.c (scm_output_port_p): Bugfix: Coerce output port before
testing (otherwise the port-print-state trick won't be transparent to the user; one example where this caused problems was in the (ice-9 format) module).
-rw-r--r--libguile/ports.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libguile/ports.c b/libguile/ports.c
index 0c88b7e26..b7cdbd2dc 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -621,7 +621,7 @@ scm_input_port_p (x)
SCM x;
{
if (SCM_IMP (x))
- return SCM_BOOL_F;
+ return SCM_BOOL_F;
return SCM_INPORTP (x) ? SCM_BOOL_T : SCM_BOOL_F;
}
@@ -632,7 +632,9 @@ scm_output_port_p (x)
SCM x;
{
if (SCM_IMP (x))
- return SCM_BOOL_F;
+ return SCM_BOOL_F;
+ if (SCM_PORT_WITH_PS_P (x))
+ x = SCM_PORT_WITH_PS_PORT (x);
return SCM_OUTPORTP (x) ? SCM_BOOL_T : SCM_BOOL_F;
}