Merge pull request #1242 from rbehrends/interactive-eof-fix
Properly terminate "nimrod i" on end of file.
This commit is contained in:
commit
67cef1b8b1
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue