diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-09-19 09:44:39 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-09-19 09:44:39 +0000 |
commit | d30971a0f40d716b644eecbd1d874742d84d57fd (patch) | |
tree | 7ab1b1b6d5c5bd7effdad00cbf20114b9e0f2aaf | |
parent | e8b0a65926d5a5ff368f385b8f40e872b3e41537 (diff) | |
download | bc-tarball-baserock/liw/S8700-bc-segfault.tar.gz |
Fix readline use so that control-c clears input bufferbaserock/liw/S8700-bc-segfault
Patch from Debian's bc package (see Debian bug #287210). Basically,
without the patch, bc won't clear the input buffer when the user
types control-C, and so this happens:
1
(interrupt) use quit to exit.
2+3
15
The expected result is 6, not 15.
-rw-r--r-- | bc/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -358,6 +358,9 @@ use_quit (sig) errno = save; #else write (1, "\n(interrupt) Exiting bc.\n", 26); +#ifdef READLINE + rl_initialize (); /* Clear readline buffer */ +#endif #if defined(LIBEDIT) if (edit != NULL) el_end(edit); |