From 380463881aa6de9cbbdb9a7c82da8818b76547c2 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Thu, 4 Dec 1997 16:03:58 +0000 Subject: [PATCH] * filesys.c (scm_stat): Coerce output port only if argument *is* an output port! (Thanks to Harald Meland.) --- THANKS | 1 + libguile/ChangeLog | 5 +++++ libguile/filesys.c | 4 +--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/THANKS b/THANKS index 8c7483475..687689a8b 100644 --- a/THANKS +++ b/THANKS @@ -16,6 +16,7 @@ Bug reports and fixes from: Christopher Lee Roland McGrath Clark McGrew + Harald Meland Thomas Morgan Jim Ravan Daniel Risacher diff --git a/libguile/ChangeLog b/libguile/ChangeLog index f8eb2ce97..7ec3a69e9 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +1997-12-04 Mikael Djurfeldt + + * filesys.c (scm_stat): Coerce output port only if argument *is* + an output port! (Thanks to Harald Meland.) + Wed Dec 3 12:23:06 1997 Jim Blandy * ports.c (scm_close_port): Make sure the port is open before diff --git a/libguile/filesys.c b/libguile/filesys.c index 4bcc7e424..ca0e1cb05 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -426,8 +426,6 @@ scm_stat (object) int fdes; struct stat stat_temp; - object = SCM_COERCE_OUTPORT (object); - SCM_DEFER_INTS; if (SCM_INUMP (object) || (SCM_NIMP (object) && SCM_OPFPORTP (object))) { @@ -435,7 +433,7 @@ scm_stat (object) fdes = SCM_INUM (object); else { - fdes = fileno ((FILE *) SCM_STREAM (object)); + fdes = fileno ((FILE *) SCM_STREAM (SCM_COERCE_OUTPORT (object))); if (fdes == -1) scm_syserror (s_stat); }