Browse Source

[lua] fix issue where Process output occasionally is missing some data

Justin Donaldson 6 years ago
parent
commit
3c905f0909
1 changed files with 7 additions and 1 deletions
  1. 7 1
      std/lua/_std/sys/io/Process.hx

+ 7 - 1
std/lua/_std/sys/io/Process.hx

@@ -151,7 +151,13 @@ private class ProcessInput extends haxe.io.Input {
 			idx = 0;
 			var pending = true;
 			b.read_start(function(err, chunk){
-				if (chunk != null) buf = chunk;
+				if (chunk != null){
+					if (buf != null){
+						buf = buf + chunk;
+					} else {
+						buf = chunk;
+					}
+				}
 				if (err != null) err_str = err;
 				pending = false;
 			});