Parcourir la source

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

Justin Donaldson il y a 6 ans
Parent
commit
3c905f0909
1 fichiers modifiés avec 7 ajouts et 1 suppressions
  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;
 			});