From ff88908531a9d20667c6d08f01d7d887ebb60fe8 Mon Sep 17 00:00:00 2001 From: N-R-K <79544946+N-R-K@users.noreply.github.com> Date: Sun, 19 Dec 2021 23:05:35 +0600 Subject: specify func argument and related cleanup (#183) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * specifies the function argument type in commands.h compared to leaving it unspecified. all the functions in cmd_t must have arg_t as it's argument. * changes to commands.h will now trigger a rebuild - this restores old behavior prior to 12efa0e * cg_quit now uses it's argument as exit status * DestroyNotify invokes cg_quit rather than calling exit directly. * Explicitly pass EXIT_SUCCESS to cgquit in keybinding Co-authored-by: Berke Kocaoğlu --- commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'commands.c') diff --git a/commands.c b/commands.c index f44cee1..64f609d 100644 --- a/commands.c +++ b/commands.c @@ -52,7 +52,7 @@ extern int markidx; extern int prefix; extern bool extprefix; -bool cg_quit(arg_t _) +bool cg_quit(arg_t status) { unsigned int i; @@ -62,7 +62,7 @@ bool cg_quit(arg_t _) printf("%s%c", files[i].name, options->using_null ? '\0' : '\n'); } } - exit(EXIT_SUCCESS); + exit(status); } bool cg_switch_mode(arg_t _) -- cgit v1.2.3-54-g00ecf