Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 5c / 1857abc6dbf3d23154eec1ea785a9056024a80
1 Return-Path: <tomi.ollila@iki.fi>\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 1BF6D431FBD\r
6         for <notmuch@notmuchmail.org>; Wed, 22 Jan 2014 09:30:27 -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 okzLUm7lM6c7 for <notmuch@notmuchmail.org>;\r
16         Wed, 22 Jan 2014 09:30:21 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 7C37F431FAF\r
19         for <notmuch@notmuchmail.org>; Wed, 22 Jan 2014 09:30:21 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id 2EF511000B3;\r
22         Wed, 22 Jan 2014 19:30:12 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH] lib: make notmuch_threads_valid return FALSE when passed\r
26         NULL\r
27 In-Reply-To: <1390408979-28606-1-git-send-email-david@tethera.net>\r
28 References: <8738kgrxyf.fsf@zancas.localnet>\r
29         <1390408979-28606-1-git-send-email-david@tethera.net>\r
30 User-Agent: Notmuch/0.17+41~g8e7fabf (http://notmuchmail.org) Emacs/24.3.1\r
31         (x86_64-unknown-linux-gnu)\r
32 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
33         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
34         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
35 Date: Wed, 22 Jan 2014 19:30:11 +0200\r
36 Message-ID: <m2r47zrkkc.fsf@guru.guru-group.fi>\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Wed, 22 Jan 2014 17:30:27 -0000\r
52 \r
53 On Wed, Jan 22 2014, David Bremner <david@tethera.net> wrote:\r
54 \r
55 > Without this patch, the example code in the header docs crashes for certain\r
56 > invalid queries (see id:871u00oimv.fsf@approx.mit.edu)\r
57 > ---\r
58 \r
59 Looks good and seems to work:\r
60 \r
61 $ make\r
62 ...\r
63 $ notmuch show foo..\r
64 A Xapian exception occurred performing query: Unknown range operation\r
65 Query string was: foo..\r
66 zsh: segmentation fault  notmuch show foo..\r
67 $ ./notmuch show foo..\r
68 A Xapian exception occurred performing query: Unknown range operation\r
69 Query string was: foo..\r
70 \r
71 (i.e. no "segmentation fault" in the latter)\r
72 \r
73 Tomi\r
74 \r
75 \r
76 >  lib/notmuch.h | 2 ++\r
77 >  lib/query.cc  | 3 +++\r
78 >  2 files changed, 5 insertions(+)\r
79 >\r
80 > diff --git a/lib/notmuch.h b/lib/notmuch.h\r
81 > index 02604c5..68896ae 100644\r
82 > --- a/lib/notmuch.h\r
83 > +++ b/lib/notmuch.h\r
84 > @@ -802,6 +802,8 @@ notmuch_query_destroy (notmuch_query_t *query);\r
85 >   * valid object. Whereas when this function returns FALSE,\r
86 >   * notmuch_threads_get will return NULL.\r
87 >   *\r
88 > + * If passed a NULL pointer, this function returns FALSE\r
89 > + *\r
90 >   * See the documentation of notmuch_query_search_threads for example\r
91 >   * code showing how to iterate over a notmuch_threads_t object.\r
92 >   */\r
93 > diff --git a/lib/query.cc b/lib/query.cc\r
94 > index ec60e2e..60ff8bd 100644\r
95 > --- a/lib/query.cc\r
96 > +++ b/lib/query.cc\r
97 > @@ -462,6 +462,9 @@ notmuch_threads_valid (notmuch_threads_t *threads)\r
98 >  {\r
99 >      unsigned int doc_id;\r
100 >  \r
101 > +    if (! threads)\r
102 \r
103 This format seems to be consistent with surrounding code (vs. threads == NULL)\r
104 \r
105 > +     return FALSE;\r
106 > +\r
107 >      while (threads->doc_id_pos < threads->doc_ids->len) {\r
108 >       doc_id = g_array_index (threads->doc_ids, unsigned int,\r
109 >                               threads->doc_id_pos);\r
110 > -- \r
111 > 1.8.5.2\r