[Patch v2 4/5] bindings/ruby: gitignore *.o
[notmuch-archives.git] / d6 / 071d7721590d657e94cafa654a3a56d91b737f
1 Return-Path: <bremner@tethera.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id AEC0A431FC7\r
6         for <notmuch@notmuchmail.org>; Thu, 23 Jan 2014 04:24:21 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id nHwtTDhIwk-H for <notmuch@notmuchmail.org>;\r
16         Thu, 23 Jan 2014 04:24:15 -0800 (PST)\r
17 Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
18         (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 29B61431FB6\r
21         for <notmuch@notmuchmail.org>; Thu, 23 Jan 2014 04:24:15 -0800 (PST)\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
23         (envelope-from <bremner@tethera.net>)\r
24         id 1W6JKQ-0006Wk-CX; Thu, 23 Jan 2014 08:24:14 -0400\r
25 Received: (nullmailer pid 17157 invoked by uid 1000); Thu, 23 Jan 2014\r
26         12:24:07 -0000\r
27 From: David Bremner <david@tethera.net>\r
28 To: notmuch@notmuchmail.org\r
29 Subject: [PATCH 3/3] notmuch-show: detect xapian exception in query\r
30 Date: Thu, 23 Jan 2014 08:24:01 -0400\r
31 Message-Id: <1390479841-17045-4-git-send-email-david@tethera.net>\r
32 X-Mailer: git-send-email 1.8.5.2\r
33 In-Reply-To: <1390479841-17045-1-git-send-email-david@tethera.net>\r
34 References: <m2r47zrkkc.fsf@guru.guru-group.fi>\r
35         <1390479841-17045-1-git-send-email-david@tethera.net>\r
36 X-BeenThere: notmuch@notmuchmail.org\r
37 X-Mailman-Version: 2.1.13\r
38 Precedence: list\r
39 List-Id: "Use and development of the notmuch mail system."\r
40         <notmuch.notmuchmail.org>\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
44 List-Post: <mailto:notmuch@notmuchmail.org>\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
48 X-List-Received-Date: Thu, 23 Jan 2014 12:24:21 -0000\r
49 \r
50 We want to return an error status, not 0 or (worse) segfault.\r
51 ---\r
52  notmuch-show.c    | 6 +++++-\r
53  test/T520-show.sh | 1 -\r
54  2 files changed, 5 insertions(+), 2 deletions(-)\r
55 \r
56 diff --git a/notmuch-show.c b/notmuch-show.c\r
57 index 528694b..b162738 100644\r
58 --- a/notmuch-show.c\r
59 +++ b/notmuch-show.c\r
60 @@ -1015,9 +1015,13 @@ do_show (void *ctx,\r
61      notmuch_messages_t *messages;\r
62      notmuch_status_t status, res = NOTMUCH_STATUS_SUCCESS;\r
63  \r
64 +    threads = notmuch_query_search_threads (query);\r
65 +    if (! threads)\r
66 +       return NOTMUCH_STATUS_XAPIAN_EXCEPTION;\r
67 +\r
68      sp->begin_list (sp);\r
69  \r
70 -    for (threads = notmuch_query_search_threads (query);\r
71 +    for ( ;\r
72          notmuch_threads_valid (threads);\r
73          notmuch_threads_move_to_next (threads))\r
74      {\r
75 diff --git a/test/T520-show.sh b/test/T520-show.sh\r
76 index bdd9d71..0657c99 100755\r
77 --- a/test/T520-show.sh\r
78 +++ b/test/T520-show.sh\r
79 @@ -6,7 +6,6 @@ test_description='"notmuch show"'\r
80  add_email_corpus\r
81  \r
82  test_begin_subtest "exit code for show invalid query"\r
83 -test_subtest_known_broken\r
84  notmuch show foo..\r
85  exit_code=$?\r
86  test_expect_equal 1 $exit_code\r
87 -- \r
88 1.8.5.2\r
89 \r