summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2014-06-03 00:24:19 +0200
committerAndreas Rumpf <rumpf_a@web.de>2014-06-03 00:24:19 +0200
commit67cef1b8b16698ed76f760d268e555dec068d0c3 (patch)
treecf86a654db0c1e24f9d3ef7b682c8f799591bce9
parent0d65550abb7da0e4ee79c30ef3d4245e77f0af43 (diff)
parentc2b58f3a542655d877c2b6f6662466338cc4606b (diff)
downloadNim-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.nim3
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