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
commit 2a1620490c

View file

@ -15,7 +15,8 @@ proc readOutput(p: Process): string =
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) if result.len > 0:
result.setLen(result.len - "\n".len)
discard p.waitForExit discard p.waitForExit
proc opGorge*(cmd, input: string): string = proc opGorge*(cmd, input: string): string =