protect against new stupid setlen that doesn't accept -1 anymore

This commit is contained in:
Araq
2015-06-24 20:34:42 +02:00
parent eef0e1bde1
commit 2a1620490c

View File

@@ -15,7 +15,8 @@ proc readOutput(p: Process): string =
while not output.atEnd:
result.add(output.readLine)
result.add("\n")
result.setLen(result.len - "\n".len)
if result.len > 0:
result.setLen(result.len - "\n".len)
discard p.waitForExit
proc opGorge*(cmd, input: string): string =