diff options
author | John Hawthorn <john.hawthorn@gmail.com> | 2016-05-02 21:48:09 -0700 |
---|---|---|
committer | John Hawthorn <john.hawthorn@gmail.com> | 2016-05-02 21:48:09 -0700 |
commit | be5dc790c83dd8fa406457dc42f58fa6dddf7885 (patch) | |
tree | b39381900721610f0d843eb1b240d78142039310 | |
parent | 447c42291c157080a59a2701c9a726963b2706a1 (diff) |
Make run returns on success, then exit from main
No real advantage, but I get to feel warm and fuzzy about
HEAP SUMMARY:
in use at exit: 0 bytes in 0 blocks
total heap usage: 8 allocs, 8 frees, 15,425 bytes allocated
-rw-r--r-- | fzy.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -99,8 +99,6 @@ static void emit(choices_t *choices) { /* No match, output the query instead */ printf("%s\n", search); } - - exit(EXIT_SUCCESS); } #define KEY_CTRL(key) ((key) - ('@')) @@ -152,6 +150,9 @@ static void run(tty_t *tty, choices_t *choices) { tty_close(tty); emit(choices); + + /* Return to eventually exit successfully */ + return; } else if (ch == KEY_ESC) { /* ESC */ ch = tty_getchar(tty); if (ch == '[' || ch == 'O') { |