From f9c46b04a61c2ea1362b33e69c6e211f2d225354 Mon Sep 17 00:00:00 2001 From: Reimer Behrends Date: Wed, 10 Sep 2014 01:22:20 +0200 Subject: [PATCH] Properly handle staticExec() generating large output. A staticExec() invocation that generated more than the internal buffer size worth of output blocked because the compiler waited for the process to terminate before reading the output. --- compiler/vmdeps.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/vmdeps.nim b/compiler/vmdeps.nim index 9a213d8133..fdd8276cc3 100644 --- a/compiler/vmdeps.nim +++ b/compiler/vmdeps.nim @@ -12,11 +12,11 @@ import ast, types, msgs, osproc, streams, options proc readOutput(p: PProcess): string = result = "" var output = p.outputStream - discard p.waitForExit while not output.atEnd: result.add(output.readLine) result.add("\n") result.setLen(result.len - "\n".len) + discard p.waitForExit proc opGorge*(cmd, input: string): string = var p = startCmd(cmd)