diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-06 13:08:36 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-06 13:08:36 -0700 |
commit | 59aa1488ac6deec474dc5287d4866223e1bcd005 (patch) | |
tree | 79c9d6fbaf3c252bfe44b4727754f124a7bc168e | |
parent | 7ffe8d302ab56ffe96023daf015a477934b7f17b (diff) | |
download | txr-59aa1488ac6deec474dc5287d4866223e1bcd005.tar.gz txr-59aa1488ac6deec474dc5287d4866223e1bcd005.tar.bz2 txr-59aa1488ac6deec474dc5287d4866223e1bcd005.zip |
Distinguish interrupt indication from linenoise.
* parser.c (repl): If linenoise returns a null pointer,
but the last error is lino_eof, print "** intr" message and
continue; do not quit.
-rw-r--r-- | parser.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -509,8 +509,12 @@ val repl(val bindings, val in_stream, val out_stream) free (prompt_u8); prompt_u8 = 0; - if (line_u8 == 0) - break; + if (line_u8 == 0) { + if (lino_get_error(ls) == lino_eof) + break; + put_line(lit("** intr"), out_stream); + continue; + } if (strspn(line_u8, " \t") == strlen(line_u8)) continue; |