src/Pure/ML-Systems/smlnj.ML
changeset 7890 0aa16bc2abdb
parent 7855 092a6435afad
child 10725 ea048ad15283
--- a/src/Pure/ML-Systems/smlnj.ML	Wed Oct 20 12:52:56 1999 +0200
+++ b/src/Pure/ML-Systems/smlnj.ML	Wed Oct 20 15:22:56 1999 +0200
@@ -87,7 +87,9 @@
     val out_buffer = ref ([]: string list);
     val out = {say = (fn s => out_buffer := s :: ! out_buffer), flush = (fn () => ())};
 
-    fun show_output () = print (implode (rev (! out_buffer)));
+    fun show_output () =
+      let val str = implode (rev (! out_buffer))
+      in print (String.substring (str, 0, Int.max (0, size str - 1))) end;
   in
     Compiler.Control.Print.out := out;
     Compiler.Interact.useStream (TextIO.openString txt) handle exn =>