From: Jani Nikula Date: Mon, 6 Feb 2012 19:57:23 +0000 (+0200) Subject: cli: reach previously unreachable cleanup code in "notmuch show" X-Git-Tag: debian/0.12_rc1-1~92 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=2c8959dad8863d185b237ed3e1f947fc46b32c98 cli: reach previously unreachable cleanup code in "notmuch show" The last lines of notmuch_show_command() function were unreachable. Fix it by using a variable for return value. Signed-off-by: Jani Nikula --- diff --git a/notmuch-show.c b/notmuch-show.c index 8f72e587..d930f942 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -1029,7 +1029,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[])) notmuch_database_t *notmuch; notmuch_query_t *query; char *query_string; - int opt_index; + int opt_index, ret; const notmuch_show_format_t *format = &format_text; notmuch_show_params_t params = { .part = -1 }; int format_sel = NOTMUCH_FORMAT_NOT_SPECIFIED; @@ -1134,9 +1134,9 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[])) } if (params.part >= 0) - return do_show_single (ctx, query, format, ¶ms); + ret = do_show_single (ctx, query, format, ¶ms); else - return do_show (ctx, query, format, ¶ms); + ret = do_show (ctx, query, format, ¶ms); notmuch_query_destroy (query); notmuch_database_close (notmuch); @@ -1144,5 +1144,5 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[])) if (params.cryptoctx) g_object_unref(params.cryptoctx); - return 0; + return ret; }