diff options
-rw-r--r-- | libguile/ChangeLog | 3 | ||||
-rw-r--r-- | libguile/print.h | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 7ec3a69e9..61e2c79b3 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,5 +1,8 @@ 1997-12-04 Mikael Djurfeldt <mdj@mdj.nada.kth.se> + * print.h (SCM_COERCE_OUTPORT): Check that the object is a pair + before taking the CDR. + * filesys.c (scm_stat): Coerce output port only if argument *is* an output port! (Thanks to Harald Meland.) diff --git a/libguile/print.h b/libguile/print.h index b686ed8bd..99de7f5e7 100644 --- a/libguile/print.h +++ b/libguile/print.h @@ -70,7 +70,9 @@ extern scm_option scm_print_opts[]; #define SCM_WRITINGP(pstate) ((pstate)->writingp) #define SCM_SET_WRITINGP(pstate, x) { (pstate)->writingp = (x); } -#define SCM_COERCE_OUTPORT(p) ((SCM_NIMP (p) && SCM_PRINT_STATE_P (SCM_CDR (p))) \ +#define SCM_COERCE_OUTPORT(p) ((SCM_NIMP (p) \ + && SCM_CONSP (p) \ + && SCM_PRINT_STATE_P (SCM_CDR (p))) \ ? SCM_CAR (p) \ : p) |