Fix crash when exiting mirb using ctrl-d when compiled with readline

support.
This commit is contained in:
Carson McDonald
2013-02-17 07:23:32 -05:00
parent 92cf2a0ced
commit fb5e83a69b
+4
View File
@@ -191,6 +191,10 @@ main(void)
last_code_line[char_index] = '\0';
#else
char* line = readline(code_block_open ? "* " : "> ");
if(line == NULL) {
printf("\n");
break;
}
strncat(last_code_line, line, sizeof(last_code_line)-1);
add_history(line);
free(line);