[PATCH v2 3/3] cli: reach previously unreachable cleanup code in "notmuch show"

Jani Nikula jani at nikula.org
Mon Feb 6 11:57:23 PST 2012


The last lines of notmuch_show_command() function were
unreachable. Fix it by using a variable for return value.

Signed-off-by: Jani Nikula <jani at nikula.org>
---
 notmuch-show.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index b358278..c8fbd79 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -1064,7 +1064,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;
@@ -1169,9 +1169,9 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
     }
 
     if (params.part >= 0)
-	return do_show_single (ctx, query, format, &params);
+	ret = do_show_single (ctx, query, format, &params);
     else
-	return do_show (ctx, query, format, &params);
+	ret = do_show (ctx, query, format, &params);
 
     notmuch_query_destroy (query);
     notmuch_database_close (notmuch);
@@ -1179,5 +1179,5 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
     if (params.cryptoctx)
 	g_object_unref(params.cryptoctx);
 
-    return 0;
+    return ret;
 }
-- 
1.7.5.4



More information about the notmuch mailing list