From 6d8d7bb8bdefebf72e5e0d7de2a70c53930e9010 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 20 Oct 2013 12:57:15 +0900 Subject: [PATCH] exit repl with ^D --- src/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 88ff9ea8..82fd2174 100644 --- a/src/main.c +++ b/src/main.c @@ -38,7 +38,7 @@ main() #if PIC_ENABLE_READLINE read_line = readline(prompt); if (read_line == NULL) { - line[0] = '\0'; + goto eof; } else { strncpy(line, read_line, LINE_MAX_LENGTH - 1); @@ -93,11 +93,9 @@ main() pic_gc_arena_restore(pic, ai); } -#if ! PIC_ENABLE_READLINE eof: puts(""); goto exit; -#endif overflow: puts("** [fatal] line input overflow");