diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-05-08 04:28:27 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-05-08 04:31:14 +0200 |
commit | bdbc4b33f0ff6f1f9c9ecf3b2a836337d0063b9d (patch) | |
tree | b37b2dde06755eed783ca9985a6b1039732d01a4 /degesch.c | |
parent | 90ddcc3454706bcafe922729155d8604327b4f47 (diff) | |
download | xK-bdbc4b33f0ff6f1f9c9ecf3b2a836337d0063b9d.tar.gz xK-bdbc4b33f0ff6f1f9c9ecf3b2a836337d0063b9d.tar.xz xK-bdbc4b33f0ff6f1f9c9ecf3b2a836337d0063b9d.zip |
degesch: prevent segfault on exit with libedit
Diffstat (limited to 'degesch.c')
-rw-r--r-- | degesch.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -5727,7 +5727,10 @@ on_tty_readable (const struct pollfd *fd, struct app_context *ctx) if (fd->revents & ~(POLLIN | POLLHUP | POLLERR)) print_debug ("fd %d: unexpected revents: %d", fd->fd, fd->revents); - input_on_readable (&ctx->input); + // XXX: this may loop for a bit: stop the event or eat the input? + // (This prevents a segfault when the input has been stopped.) + if (ctx->input.active) + input_on_readable (&ctx->input); } // --- Configuration loading --------------------------------------------------- |