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 7632540B95B
\r
6 for <notmuch@notmuchmail.org>; Fri, 16 Jul 2010 04:33:10 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 y60vEewHnGFz for <notmuch@notmuchmail.org>;
\r
16 Fri, 16 Jul 2010 04:32:59 -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 B4B0D40B95D
\r
19 for <notmuch@notmuchmail.org>; Fri, 16 Jul 2010 04:32:59 -0700 (PDT)
\r
20 Received: from localhost (unknown [192.168.200.4])
\r
21 by max.feld.cvut.cz (Postfix) with ESMTP id CCF8919F33D7;
\r
22 Fri, 16 Jul 2010 13:32:58 +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
27 with ESMTP id z3X13Mb1ug0E; Fri, 16 Jul 2010 13:32:57 +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 A451F19F33A8;
\r
30 Fri, 16 Jul 2010 13:32:57 +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 9EFE615C027;
\r
34 Fri, 16 Jul 2010 13:32:57 +0200 (CEST)
\r
35 Received: from wsh by steelpick.2x.cz with local (Exim 4.72)
\r
36 (envelope-from <sojkam1@fel.cvut.cz>)
\r
37 id 1OZjA1-0000oe-B3; Fri, 16 Jul 2010 13:32:57 +0200
\r
38 From: Michal Sojka <sojkam1@fel.cvut.cz>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH] emacs: Fix stack overflow in notmuch-wash-tidy-citations
\r
41 Date: Fri, 16 Jul 2010 13:32:35 +0200
\r
42 Message-Id: <1279279955-3110-1-git-send-email-sojkam1@fel.cvut.cz>
\r
43 X-Mailer: git-send-email 1.7.1.3.g75e44
\r
44 X-BeenThere: notmuch@notmuchmail.org
\r
45 X-Mailman-Version: 2.1.13
\r
47 List-Id: "Use and development of the notmuch mail system."
\r
48 <notmuch.notmuchmail.org>
\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
52 List-Post: <mailto:notmuch@notmuchmail.org>
\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
56 X-List-Received-Date: Fri, 16 Jul 2010 11:33:10 -0000
\r
58 The following message (146 kB) breaks the emacs interface:
\r
59 http://rtime.felk.cvut.cz/~sojka/notmuch/notmuch-wash-tidy-citations-stack-overflow.txt
\r
61 An attempt to view the message produced message
\r
62 "notmuch-wash-tidy-citations: Stack overflow in regexp matcherq" and
\r
63 it was not possible to work with the message.
\r
65 I tracked the problem down to the regexp search, which probably
\r
66 attempts to match a very big piece of text (several lines). I changed
\r
67 the regexp to only match a single line. The result is probably slower,
\r
68 but doesn't produce the error.
\r
70 emacs/notmuch-wash.el | 2 +-
\r
71 1 files changed, 1 insertions(+), 1 deletions(-)
\r
73 diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
\r
74 index 26a3f88..051dd17 100644
\r
75 --- a/emacs/notmuch-wash.el
\r
76 +++ b/emacs/notmuch-wash.el
\r
77 @@ -218,7 +218,7 @@ Perform four transformations on the message body:
\r
79 ;; Insert a blank line before a citation if there isn't one.
\r
80 (goto-char (point-min))
\r
81 - (while (re-search-forward "\\(^[^>]+\\)\n>" nil t)
\r
82 + (while (re-search-forward "\\(^[^>][^\n]+\\)\n>" nil t)
\r
83 (replace-match "\\1\n\n>"))
\r
85 ;; Insert a blank line after a citation if there isn't one.
\r