diff --git a/src/VM.cpp b/src/VM.cpp index 64d904e..79ed19a 100644 --- a/src/VM.cpp +++ b/src/VM.cpp @@ -241,8 +241,8 @@ void Thread::getLine() } line = el_gets(el, &linelen); linepos = 0; - if (strncmp(line, "quit", 4)==0 || strncmp(line, "..", 2)==0) { line = NULL; throw errUserQuit; } - if (line && linelen) { + if (!line || strncmp(line, "quit", 4)==0 || strncmp(line, "..", 2)==0) { line = NULL; throw errUserQuit; } + if (linelen > 0) { history(myhistory, &ev, H_ENTER, line); history(myhistory, &ev, H_SAVE, historyfilename); if (logfilename) {