mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-23 19:36:53 +00:00
Merge pull request #1242 from rbehrends/interactive-eof-fix
Properly terminate "nimrod i" on end of file.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user