bulk read: observe EOF protocol more carefully -- 0 counts as successful read;
authorwenzelm
Mon, 27 Sep 2010 18:11:33 +0200
changeset 39731 5cb0d7b0d601
parent 39730 e4e1e3b69cba
child 39732 4dbc72759706
bulk read: observe EOF protocol more carefully -- 0 counts as successful read;
src/Pure/System/isabelle_process.scala
--- a/src/Pure/System/isabelle_process.scala	Mon Sep 27 18:10:21 2010 +0200
+++ b/src/Pure/System/isabelle_process.scala	Mon Sep 27 18:11:33 2010 +0200
@@ -335,8 +335,8 @@
         var m = 0
         do {
           m = stream.read(buf, i, n - i)
-          i += m
-        } while (m > 0 && n > i)
+          if (m != -1) i += m
+        } while (m != -1 && n > i)
 
         if (i != n) throw new Protocol_Error("bad message chunk content")