diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2014-06-03 00:24:19 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2014-06-03 00:24:19 +0200 |
commit | 67cef1b8b16698ed76f760d268e555dec068d0c3 (patch) | |
tree | cf86a654db0c1e24f9d3ef7b682c8f799591bce9 | |
parent | 0d65550abb7da0e4ee79c30ef3d4245e77f0af43 (diff) | |
parent | c2b58f3a542655d877c2b6f6662466338cc4606b (diff) | |
download | Nim-67cef1b8b16698ed76f760d268e555dec068d0c3.tar.gz |
Merge pull request #1242 from rbehrends/interactive-eof-fix
Properly terminate "nimrod i" on end of file.
-rw-r--r-- | compiler/llstream.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/llstream.nim b/compiler/llstream.nim index 510880ffd..86bfeaabd 100644 --- a/compiler/llstream.nim +++ b/compiler/llstream.nim @@ -82,6 +82,9 @@ when not defined(readLineFromStdin): proc readLineFromStdin(prompt: string, line: var string): bool = stdout.write(prompt) result = readLine(stdin, line) + if not result: + stdout.write("\n") + quit(0) proc endsWith*(x: string, s: set[char]): bool = var i = x.len-1 |