mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 22:28:45 +01:00
Fix #6. Handle Ctrl-D in REPL.
This commit is contained in:
@ -69,6 +69,13 @@ static int runRepl(WrenVM* vm)
|
||||
char line[MAX_LINE];
|
||||
fgets(line, MAX_LINE, stdin);
|
||||
|
||||
// If stdin was closed (usually meaning the used entered Ctrl-D), exit.
|
||||
if (feof(stdin))
|
||||
{
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// TODO: Handle failure.
|
||||
wrenInterpret(vm, "(repl)", line);
|
||||
// TODO: Figure out how this should work with wren API.
|
||||
|
||||
Reference in New Issue
Block a user