mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user