From ee21249aa2d16c92cf9e122892627e25f8280ead Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Tue, 23 Oct 2018 22:40:58 +0300 Subject: memview: make q key quit the program --- src/memview.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/memview.c b/src/memview.c index 49a503b..07c50b1 100644 --- a/src/memview.c +++ b/src/memview.c @@ -716,6 +716,13 @@ out: return ctx.input.data; } +static void +q_quit(void *arg) +{ + (void)arg; + exit(EXIT_SUCCESS); +} + static void goto_offset(void *arg) { @@ -913,6 +920,7 @@ main(int argc, char *argv[]) { .seq = { 0x1b, '[', 'B', 0 }, .fun = navigate, .arg = MOVE_DOWN }, { .seq = { 0x1b, '[', 'C', 0 }, .fun = navigate, .arg = MOVE_RIGHT }, { .seq = { 0x1b, '[', 'D', 0 }, .fun = navigate, .arg = MOVE_LEFT }, + { .seq = { 'q', 0 }, .fun = q_quit }, { .seq = { 'o', 0 }, .fun = goto_offset }, { .seq = { 'f', 0 }, .fun = follow }, { .seq = { 'w', 0 }, .fun = write_bytes }, -- cgit v1.2.3-70-g09d2