Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / a2 / 9ab39b39ce1eabdb2ad7377415b664f0751ab3
1 Return-Path: <sojkam1@fel.cvut.cz>\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 41C104196F2\r
6         for <notmuch@notmuchmail.org>; Fri, 23 Apr 2010 06:38:06 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=ham\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 p-49Xfk77QhH for <notmuch@notmuchmail.org>;\r
16         Fri, 23 Apr 2010 06:38:05 -0700 (PDT)\r
17 Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
18         by olra.theworths.org (Postfix) with ESMTP id 56ED5431FC1\r
19         for <notmuch@notmuchmail.org>; Fri, 23 Apr 2010 06:38:05 -0700 (PDT)\r
20 Received: from localhost (unknown [192.168.200.4])\r
21         by max.feld.cvut.cz (Postfix) with ESMTP id 4B2E019F33D6;\r
22         Fri, 23 Apr 2010 15:38:04 +0200 (CEST)\r
23 X-Virus-Scanned: IMAP AMAVIS\r
24 Received: from max.feld.cvut.cz ([192.168.200.1])\r
25         by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
26         port 10044)\r
27         with ESMTP id rCm5xrhbu0B2; Fri, 23 Apr 2010 15:38:00 +0200 (CEST)\r
28 Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
29         by max.feld.cvut.cz (Postfix) with ESMTP id 9F6DE19F332E;\r
30         Fri, 23 Apr 2010 15:38:00 +0200 (CEST)\r
31 Received: from steelpick.2x.cz (k335-30.felk.cvut.cz [147.32.86.30])\r
32         (Authenticated sender: sojkam1)\r
33         by imap.feld.cvut.cz (Postfix) with ESMTPSA id 8B83DFA003;\r
34         Fri, 23 Apr 2010 15:38:00 +0200 (CEST)\r
35 Received: from wsh by steelpick.2x.cz with local (Exim 4.71)\r
36         (envelope-from <sojkam1@fel.cvut.cz>)\r
37         id 1O5J4x-0003vq-9l; Fri, 23 Apr 2010 15:37:59 +0200\r
38 From: Michal Sojka <sojkam1@fel.cvut.cz>\r
39 To: Sebastian Spaeth <Sebastian@SSpaeth.de>,\r
40         Notmuch development list <notmuch@notmuchmail.org>\r
41 Subject: Re: notmuch segfault\r
42 In-Reply-To: <87d3xqti3o.fsf@SSpaeth.de>\r
43 References: <8739ym4mxk.fsf@SSpaeth.de> <87d3xqti3o.fsf@SSpaeth.de>\r
44 Date: Fri, 23 Apr 2010 15:37:59 +0200\r
45 Message-ID: <87sk6m2sso.fsf@steelpick.2x.cz>\r
46 MIME-Version: 1.0\r
47 Content-Type: text/plain; charset=us-ascii\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Fri, 23 Apr 2010 13:38:06 -0000\r
61 \r
62 On Fri, 23 Apr 2010, Sebastian Spaeth wrote:\r
63 > Can it be that in thread.cc in _thread_add_matched_message ()\r
64 > ...\r
65 >     subject = notmuch_message_get_header (message, "subject");\r
66\r
67 >     if ((strncasecmp (subject, "Re: ", 4) == 0) ||\r
68 > ...\r
69\r
70 > If the underlying message disappeared, get_header will return NULL and\r
71 > we pass strncasecmp NULL as first parameter. Could that be?\r
72 \r
73 Yes, it is very likely the problem. The fix is obvious (see bellow), but\r
74 the question is how will be this "missing message" presented to the user\r
75 e.g. in notmuch show. It may be that we will need some other checks to\r
76 not break other things.\r
77 \r
78 diff --git a/lib/thread.cc b/lib/thread.cc\r
79 index 5bf8354..29b8336 100644\r
80 --- a/lib/thread.cc\r
81 +++ b/lib/thread.cc\r
82 @@ -148,6 +148,9 @@ _thread_add_matched_message (notmuch_thread_t *thread,\r
83  \r
84      subject = notmuch_message_get_header (message, "subject");\r
85  \r
86 +    if (!subject)\r
87 +       return;\r
88 +\r
89      if ((strncasecmp (subject, "Re: ", 4) == 0) ||\r
90         (strncasecmp (subject, "Aw: ", 4) == 0) ||\r
91         (strncasecmp (subject, "Vs: ", 4) == 0) ||\r