exit repl with ^D
This commit is contained in:
parent
50b9c2bd97
commit
6d8d7bb8bd
|
@ -38,7 +38,7 @@ main()
|
||||||
#if PIC_ENABLE_READLINE
|
#if PIC_ENABLE_READLINE
|
||||||
read_line = readline(prompt);
|
read_line = readline(prompt);
|
||||||
if (read_line == NULL) {
|
if (read_line == NULL) {
|
||||||
line[0] = '\0';
|
goto eof;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
strncpy(line, read_line, LINE_MAX_LENGTH - 1);
|
strncpy(line, read_line, LINE_MAX_LENGTH - 1);
|
||||||
|
@ -93,11 +93,9 @@ main()
|
||||||
pic_gc_arena_restore(pic, ai);
|
pic_gc_arena_restore(pic, ai);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ! PIC_ENABLE_READLINE
|
|
||||||
eof:
|
eof:
|
||||||
puts("");
|
puts("");
|
||||||
goto exit;
|
goto exit;
|
||||||
#endif
|
|
||||||
|
|
||||||
overflow:
|
overflow:
|
||||||
puts("** [fatal] line input overflow");
|
puts("** [fatal] line input overflow");
|
||||||
|
|
Loading…
Reference in New Issue