浏览代码

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

Justin Donaldson 6 年之前
父节点
当前提交
3c905f0909
共有 1 个文件被更改,包括 7 次插入1 次删除
  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;
 			});