1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 05:50:26 +02:00

* print.h (SCM_COERCE_OUTPORT): Check that the object is a pair

before taking the CDR.
This commit is contained in:
Mikael Djurfeldt 1997-12-04 16:18:59 +00:00
parent 380463881a
commit bfc471e7a1
2 changed files with 6 additions and 1 deletions

View file

@ -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.)

View file

@ -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)