1 Return-Path: <jani@nikula.org>
\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 BA7DF431FC9
\r
6 for <notmuch@notmuchmail.org>; Sat, 30 Nov 2013 07:34:09 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id wNrJPPBKe5-B for <notmuch@notmuchmail.org>;
\r
17 Sat, 30 Nov 2013 07:34:04 -0800 (PST)
\r
18 Received: from mail-ea0-f170.google.com (mail-ea0-f170.google.com
\r
19 [209.85.215.170]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 12D7A431FAF
\r
22 for <notmuch@notmuchmail.org>; Sat, 30 Nov 2013 07:34:03 -0800 (PST)
\r
23 Received: by mail-ea0-f170.google.com with SMTP id k10so7790543eaj.1
\r
24 for <notmuch@notmuchmail.org>; Sat, 30 Nov 2013 07:34:03 -0800 (PST)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=1e100.net; s=20130820;
\r
27 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
\r
28 :references:in-reply-to:references;
\r
29 bh=np75aVOqrb3NtR0M/v1YRcEvu6q3wIv4VSqv36hTOSA=;
\r
30 b=ca/yn+mh3We85XXE09O+hz1piT4+YaA3eAqE1QNUsGN5iMTPc0dRGYb+j01s1wpyaz
\r
31 Kp1JlXQ9o4VDdyaNdbREaddfZ4MY+HrPE5LmEtaxC4kWc7Nt4ZYNEU7DYcLB+IUlT2ja
\r
32 vN0IjhfameuE44j0QqgymdZaY3/AIc/XRZVU3uXbTWwZEE5dRjt3lC4VlqSFFpR7O1RS
\r
33 /Tyhl2GsckzHWN74+Qhn+yrDRUgQbOLkQjrxXwSYnKXy6RobRlEZp5bVUUzgntk+CzSS
\r
34 XQB/gBcxp8Zy+W/rFtaI4NyMJHJ6qJS/S731n6jL98ay2Ivsj0Vr1WDkK5IEBHpfzMz/
\r
37 ALoCoQmcWE1KGEBRT55x5w8yTl9P0ym6bibLdK0T+QbIf7eXgVF9J9p2PB+U73B14ZMAvKmJz2Si
\r
38 X-Received: by 10.14.179.130 with SMTP id h2mr25463113eem.34.1385825642995;
\r
39 Sat, 30 Nov 2013 07:34:02 -0800 (PST)
\r
40 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.
\r
42 by mx.google.com with ESMTPSA id m1sm46163441eeg.0.2013.11.30.07.34.01
\r
43 for <multiple recipients>
\r
44 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
45 Sat, 30 Nov 2013 07:34:02 -0800 (PST)
\r
46 From: Jani Nikula <jani@nikula.org>
\r
47 To: notmuch@notmuchmail.org
\r
48 Subject: [PATCH v2 1/7] cli: sanitize tabs and newlines to spaces in notmuch
\r
50 Date: Sat, 30 Nov 2013 17:33:50 +0200
\r
52 <e2c281b2dbb78bdd71a1bd1e480874d29812afdd.1385825425.git.jani@nikula.org>
\r
53 X-Mailer: git-send-email 1.8.4.2
\r
54 In-Reply-To: <cover.1385825425.git.jani@nikula.org>
\r
55 References: <cover.1385825425.git.jani@nikula.org>
\r
56 In-Reply-To: <cover.1385825425.git.jani@nikula.org>
\r
57 References: <cover.1385825425.git.jani@nikula.org>
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\r
61 List-Id: "Use and development of the notmuch mail system."
\r
62 <notmuch.notmuchmail.org>
\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
66 List-Post: <mailto:notmuch@notmuchmail.org>
\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
70 X-List-Received-Date: Sat, 30 Nov 2013 15:34:09 -0000
\r
72 Sanitize tabs and newlines to spaces rather than question marks in
\r
73 --output=summary --format=text output.
\r
75 This will also hide any difference in unfolding a header that has been
\r
76 folded with a tab. Our own header parser replaces tabs with spaces,
\r
77 while gmime would retain the tab.
\r
79 notmuch-search.c | 4 +++-
\r
80 test/search-output | 2 +-
\r
81 2 files changed, 4 insertions(+), 2 deletions(-)
\r
83 diff --git a/notmuch-search.c b/notmuch-search.c
\r
84 index 7c973b3..11cd6ee 100644
\r
85 --- a/notmuch-search.c
\r
86 +++ b/notmuch-search.c
\r
87 @@ -41,7 +41,9 @@ sanitize_string (const void *ctx, const char *str)
\r
88 loop = out = talloc_strdup (ctx, str);
\r
90 for (; *loop; loop++) {
\r
91 - if ((unsigned char)(*loop) < 32)
\r
92 + if (*loop == '\t' || *loop == '\n')
\r
94 + else if ((unsigned char)(*loop) < 32)
\r
98 diff --git a/test/search-output b/test/search-output
\r
99 index 5ccfeaf..86544ac 100755
\r
100 --- a/test/search-output
\r
101 +++ b/test/search-output
\r
102 @@ -388,7 +388,7 @@ add_message "[subject]='two =?ISO-8859-1?Q?line=0A_subject?=
\r
104 notmuch search id:"$gen_msg_id" | notmuch_search_sanitize >OUTPUT
\r
105 cat <<EOF >EXPECTED
\r
106 -thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; two line? subject headers (inbox unread)
\r
107 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; two line subject headers (inbox unread)
\r
109 test_expect_equal_file OUTPUT EXPECTED
\r