[PATCH v2 3/3] cli: reach previously unreachable cleanup code in "notmuch show"
authorJani Nikula <jani@nikula.org>
Mon, 6 Feb 2012 19:57:23 +0000 (21:57 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:13 +0000 (09:44 -0800)
31/763edbebf21e4898d9df9533b43326f3545efa [new file with mode: 0644]

diff --git a/31/763edbebf21e4898d9df9533b43326f3545efa b/31/763edbebf21e4898d9df9533b43326f3545efa
new file mode 100644 (file)
index 0000000..5a92a53
--- /dev/null
@@ -0,0 +1,101 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 0FC2A431FC7\r
+       for <notmuch@notmuchmail.org>; Mon,  6 Feb 2012 11:57:42 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id XT9-9X2uzkrw for <notmuch@notmuchmail.org>;\r
+       Mon,  6 Feb 2012 11:57:41 -0800 (PST)\r
+Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
+       [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 6DCFA431FAF\r
+       for <notmuch@notmuchmail.org>; Mon,  6 Feb 2012 11:57:38 -0800 (PST)\r
+Received: by mail-lpp01m010-f53.google.com with SMTP id d3so3838995lah.26\r
+       for <notmuch@notmuchmail.org>; Mon, 06 Feb 2012 11:57:38 -0800 (PST)\r
+Received: by 10.112.102.37 with SMTP id fl5mr5317381lbb.95.1328558258005;\r
+       Mon, 06 Feb 2012 11:57:38 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi.\r
+       [84.248.80.253])\r
+       by mx.google.com with ESMTPS id k4sm13781781lbw.10.2012.02.06.11.57.35\r
+       (version=SSLv3 cipher=OTHER); Mon, 06 Feb 2012 11:57:36 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 3/3] cli: reach previously unreachable cleanup code in\r
+       "notmuch show"\r
+Date: Mon,  6 Feb 2012 21:57:23 +0200\r
+Message-Id:\r
+ <8da04ac681ef083f60b4dd01b7fbdda241a11ce9.1328558175.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <cover.1328558175.git.jani@nikula.org>\r
+References:\r
+ <df2e9bd7682e9c81e1b205cc1d92a1526cdd1a9b.1328308635.git.jani@nikula.org>\r
+       <cover.1328558175.git.jani@nikula.org>\r
+In-Reply-To: <cover.1328558175.git.jani@nikula.org>\r
+References: <cover.1328558175.git.jani@nikula.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 06 Feb 2012 19:57:42 -0000\r
+\r
+The last lines of notmuch_show_command() function were\r
+unreachable. Fix it by using a variable for return value.\r
+\r
+Signed-off-by: Jani Nikula <jani@nikula.org>\r
+---\r
+ notmuch-show.c |    8 ++++----\r
+ 1 files changed, 4 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/notmuch-show.c b/notmuch-show.c\r
+index b358278..c8fbd79 100644\r
+--- a/notmuch-show.c\r
++++ b/notmuch-show.c\r
+@@ -1064,7 +1064,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
+     notmuch_database_t *notmuch;\r
+     notmuch_query_t *query;\r
+     char *query_string;\r
+-    int opt_index;\r
++    int opt_index, ret;\r
+     const notmuch_show_format_t *format = &format_text;\r
+     notmuch_show_params_t params = { .part = -1 };\r
+     int format_sel = NOTMUCH_FORMAT_NOT_SPECIFIED;\r
+@@ -1169,9 +1169,9 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
+     }\r
\r
+     if (params.part >= 0)\r
+-      return do_show_single (ctx, query, format, &params);\r
++      ret = do_show_single (ctx, query, format, &params);\r
+     else\r
+-      return do_show (ctx, query, format, &params);\r
++      ret = do_show (ctx, query, format, &params);\r
\r
+     notmuch_query_destroy (query);\r
+     notmuch_database_close (notmuch);\r
+@@ -1179,5 +1179,5 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
+     if (params.cryptoctx)\r
+       g_object_unref(params.cryptoctx);\r
\r
+-    return 0;\r
++    return ret;\r
+ }\r
+-- \r
+1.7.5.4\r
+\r