* coop.c, iselect.c: Since thread switches are now performed with
[bpt/guile.git] / libguile / strports.c
index 55ae2ed..4e0ea1a 100644 (file)
@@ -12,7 +12,8 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this software; see the file COPYING.  If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
  *
  * As a special exception, the Free Software Foundation gives permission
  * for additional uses of the text contained in its release of GUILE.
@@ -36,8 +37,7 @@
  *
  * If you write modifications of your own for GUILE, it is your choice
  * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.  
- */
+ * If you do not wish that, delete this exception notice.  */
 \f
 
 #include <stdio.h>
@@ -270,10 +270,14 @@ scm_eval_string (string)
   SCM ans = SCM_UNSPECIFIED;
 
   /* Read expressions from that port; ignore the values.  */
-  while ((form = scm_read (port)) != SCM_EOF_VAL)
+  while (!SCM_EOF_OBJECT_P (form = scm_read (port)))
     ans = scm_eval_x (form);
 
-  scm_close_port (port);
+  /* Don't close the port here; if we re-enter this function via a
+     continuation, then the next time we enter it, we'll get an error.
+     It's a string port anyway, so there's no advantage to closing it
+     early.  */
+
   return ans;
 }
 
@@ -300,6 +304,7 @@ scm_ptobfuns scm_stptob =
   stwrite,
   noop0,
   stgetc,
+  scm_generic_fgets,
   0
 };