Merge pull request #1242 from rbehrends/interactive-eof-fix

Properly terminate "nimrod i" on end of file.
This commit is contained in:
Andreas Rumpf 2014-06-03 00:24:19 +02:00
commit 67cef1b8b1

View file

@ -82,6 +82,9 @@ when not defined(readLineFromStdin):
proc readLineFromStdin(prompt: string, line: var string): bool = proc readLineFromStdin(prompt: string, line: var string): bool =
stdout.write(prompt) stdout.write(prompt)
result = readLine(stdin, line) result = readLine(stdin, line)
if not result:
stdout.write("\n")
quit(0)
proc endsWith*(x: string, s: set[char]): bool = proc endsWith*(x: string, s: set[char]): bool =
var i = x.len-1 var i = x.len-1