Merge pull request #1524 from rbehrends/fix-staticexec2
Properly handle staticExec() generating large output.
This commit is contained in:
commit
dcc00b3960
1 changed files with 1 additions and 1 deletions
|
|
@ -12,11 +12,11 @@ import ast, types, msgs, osproc, streams, options
|
||||||
proc readOutput(p: PProcess): string =
|
proc readOutput(p: PProcess): string =
|
||||||
result = ""
|
result = ""
|
||||||
var output = p.outputStream
|
var output = p.outputStream
|
||||||
discard p.waitForExit
|
|
||||||
while not output.atEnd:
|
while not output.atEnd:
|
||||||
result.add(output.readLine)
|
result.add(output.readLine)
|
||||||
result.add("\n")
|
result.add("\n")
|
||||||
result.setLen(result.len - "\n".len)
|
result.setLen(result.len - "\n".len)
|
||||||
|
discard p.waitForExit
|
||||||
|
|
||||||
proc opGorge*(cmd, input: string): string =
|
proc opGorge*(cmd, input: string): string =
|
||||||
var p = startCmd(cmd)
|
var p = startCmd(cmd)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue