* ioext.c (scm_duplicate_port): bug fix: don't try to make the
authorGary Houston <ghouston@arglist.com>
Sun, 22 Jun 1997 08:11:58 +0000 (08:11 +0000)
committerGary Houston <ghouston@arglist.com>
Sun, 22 Jun 1997 08:11:58 +0000 (08:11 +0000)
new port unbuffered until its stream has been set.

libguile/ChangeLog
libguile/ioext.c

index bb344bf..8bcc41e 100644 (file)
@@ -1,3 +1,8 @@
+Sun Jun 22 04:00:32 1997  Gary Houston  <ghouston@actrix.gen.nz>
+
+       * ioext.c (scm_duplicate_port): bug fix: don't try to make the
+       new port unbuffered until its stream has been set.
+
 Sat Jun 21 18:44:03 1997  Gary Houston  <ghouston@actrix.gen.nz>
 
        * ports.h: new prototype.
index ecc9aa5..44a2568 100644 (file)
@@ -271,9 +271,9 @@ scm_duplicate_port (oldpt, modes)
     pt = scm_add_to_port_table (newpt);
     SCM_SETPTAB_ENTRY (newpt, pt);
     SCM_SETCAR (newpt, scm_tc16_fport | scm_mode_bits (SCM_ROCHARS (modes)));
+    SCM_SETSTREAM (newpt, (SCM)f);
     if (SCM_BUF0 & SCM_CAR (newpt))
       scm_setbuf0 (newpt);
-    SCM_SETSTREAM (newpt, (SCM)f);
     SCM_PTAB_ENTRY (newpt)->file_name = SCM_PTAB_ENTRY (oldpt)->file_name;
   }
   SCM_ALLOW_INTS;