[PATCH 2/6] cli: sanitize tabs to spaces in notmuch search
authorJani Nikula <jani@nikula.org>
Wed, 16 Oct 2013 19:00:09 +0000 (22:00 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:26 +0000 (09:57 -0800)
56/aa746aa1f2eace437661014faa9bfe50bcdea7 [new file with mode: 0644]

diff --git a/56/aa746aa1f2eace437661014faa9bfe50bcdea7 b/56/aa746aa1f2eace437661014faa9bfe50bcdea7
new file mode 100644 (file)
index 0000000..204dda3
--- /dev/null
@@ -0,0 +1,94 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 4695A431FBF\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Oct 2013 12:00:31 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id nSTK87CLosLH for <notmuch@notmuchmail.org>;\r
+       Wed, 16 Oct 2013 12:00:25 -0700 (PDT)\r
+Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com\r
+ [74.125.83.53])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ A9880431FBC   for <notmuch@notmuchmail.org>; Wed, 16 Oct 2013 12:00:22 -0700\r
+ (PDT)\r
+Received: by mail-ee0-f53.google.com with SMTP id t10so586557eei.12\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Oct 2013 12:00:21 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+       :references:in-reply-to:references;\r
+       bh=0jhZf2PmKZqigaHc2c61VZ4OV+UCWbgw6/2uuPiZmdg=;\r
+       b=Kz4scS91bpvglyq6HYMYGsbfYosnD8AgAfN+mHRgetN6mjQJuQPC0eJCTCIUp/hP6k\r
+       txH2XHNWGPwD94cAlEg0Jg6vlNwEMJyQmG7zD+r+ienzyR7Ph/1Srse13g/96z2/LcOW\r
+       aeEgXZJd0q0a/H2exH7xj3OJtC3g6Nt1n2UsvRV8jA4ZsolGn8W1+0U0QvifWtFaSLTr\r
+       v9hnmhv0pn27XyNuVGpw2a7uX/dAZO06w9r6587DkAZHCj+ffjbUNmU3mJlEn3Ul1ghq\r
+       z29Os7NbKH/mTtoR9lXL/gKGqarkMTUEujL2CVWtRwO9S/iMTV8P15TsyEk766vFgu/q\r
+       Iefw==\r
+X-Gm-Message-State:\r
+ ALoCoQnEOrEq8xkg+8znaDTS10VqrpicE5cT3XFVCXIhVFmihJdwIL8mTE/r6N24ktEA75xw+xpO\r
+X-Received: by 10.14.214.136 with SMTP id c8mr6788769eep.6.1381950021607;\r
+       Wed, 16 Oct 2013 12:00:21 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+       [88.195.111.91]) by mx.google.com with ESMTPSA id\r
+       x47sm183065494eea.16.1969.12.31.16.00.00\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Wed, 16 Oct 2013 12:00:20 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/6] cli: sanitize tabs to spaces in notmuch search\r
+Date: Wed, 16 Oct 2013 22:00:09 +0300\r
+Message-Id:\r
+ <af8381b86275c4be77cc8527a19d69efbd2e9423.1381948853.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.8.4.rc3\r
+In-Reply-To: <cover.1381948853.git.jani@nikula.org>\r
+References: <cover.1381948853.git.jani@nikula.org>\r
+In-Reply-To: <cover.1381948853.git.jani@nikula.org>\r
+References: <cover.1381948853.git.jani@nikula.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 16 Oct 2013 19:00:31 -0000\r
+\r
+This is in preparation of switching to gmime header parsing, but\r
+arguably converting tabs to spaces rather than question marks is the\r
+right thing to do anyway.\r
+---\r
+ notmuch-search.c | 4 +++-\r
+ 1 file changed, 3 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/notmuch-search.c b/notmuch-search.c\r
+index d9d39ec..eab314f 100644\r
+--- a/notmuch-search.c\r
++++ b/notmuch-search.c\r
+@@ -40,7 +40,9 @@ sanitize_string (const void *ctx, const char *str)\r
+     loop = out = talloc_strdup (ctx, str);\r
\r
+     for (; *loop; loop++) {\r
+-      if ((unsigned char)(*loop) < 32)\r
++      if (*loop == '\t')\r
++          *loop = ' ';\r
++      else if ((unsigned char)(*loop) < 32)\r
+           *loop = '?';\r
+     }\r
+     return out;\r
+-- \r
+1.8.4.rc3\r
+\r