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