unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/2] cli: reach previously unreachable cleanup code in "notmuch show"
Date: Sat,  4 Feb 2012 00:41:09 +0200	[thread overview]
Message-ID: <5b1ad40819ff3a97a833a46663f79a7462d6996e.1328308635.git.jani@nikula.org> (raw)
In-Reply-To: <df2e9bd7682e9c81e1b205cc1d92a1526cdd1a9b.1328308635.git.jani@nikula.org>
In-Reply-To: <df2e9bd7682e9c81e1b205cc1d92a1526cdd1a9b.1328308635.git.jani@nikula.org>

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@nikula.org>
---
 notmuch-show.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index f93e121..b18e279 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;
@@ -1173,9 +1173,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);
@@ -1183,5 +1183,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

  reply	other threads:[~2012-02-03 22:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03 22:41 [PATCH 1/2] cli: convert "notmuch show" to use the new argument parser Jani Nikula
2012-02-03 22:41 ` Jani Nikula [this message]
2012-02-04  0:00 ` Mark Walters
2012-02-04  8:59   ` Jani Nikula
2012-02-06  4:12 ` Austin Clements
2012-02-06  7:54   ` Jani Nikula
2012-02-06 14:14     ` Austin Clements
2012-02-06 19:57 ` [PATCH 0/3] notmuch show argument parsing Jani Nikula
2012-02-06 19:57   ` [PATCH v2 1/3] cli: use notmuch_bool_t for boolean fields in notmuch_show_params_t Jani Nikula
2012-02-06 19:57   ` [PATCH v2 2/3] cli: convert "notmuch show" to use the new argument parser Jani Nikula
2012-02-06 19:57   ` [PATCH v2 3/3] cli: reach previously unreachable cleanup code in "notmuch show" Jani Nikula
2012-02-06 21:08   ` [PATCH 0/3] notmuch show argument parsing Austin Clements
2012-02-10 15:59   ` Mark Walters
2012-02-12 17:34   ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b1ad40819ff3a97a833a46663f79a7462d6996e.1328308635.git.jani@nikula.org \
    --to=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).