From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/6] cli: sanitize tabs to spaces in notmuch search
Date: Wed, 16 Oct 2013 22:00:09 +0300 [thread overview]
Message-ID: <af8381b86275c4be77cc8527a19d69efbd2e9423.1381948853.git.jani@nikula.org> (raw)
In-Reply-To: <cover.1381948853.git.jani@nikula.org>
In-Reply-To: <cover.1381948853.git.jani@nikula.org>
This is in preparation of switching to gmime header parsing, but
arguably converting tabs to spaces rather than question marks is the
right thing to do anyway.
---
notmuch-search.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/notmuch-search.c b/notmuch-search.c
index d9d39ec..eab314f 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -40,7 +40,9 @@ sanitize_string (const void *ctx, const char *str)
loop = out = talloc_strdup (ctx, str);
for (; *loop; loop++) {
- if ((unsigned char)(*loop) < 32)
+ if (*loop == '\t')
+ *loop = ' ';
+ else if ((unsigned char)(*loop) < 32)
*loop = '?';
}
return out;
--
1.8.4.rc3
next prev parent reply other threads:[~2013-10-16 19:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-16 19:00 [PATCH 0/6] lib: replace the message header parser with gmime Jani Nikula
2013-10-16 19:00 ` [PATCH 1/6] emacs: Sanitize authors and subjects in search and show Jani Nikula
2013-10-16 19:00 ` Jani Nikula [this message]
2013-10-17 8:07 ` [PATCH 2/6] cli: sanitize tabs to spaces in notmuch search Mark Walters
2013-10-17 11:47 ` Jani Nikula
2013-10-16 19:00 ` [PATCH 3/6] cli: make the hacky from guessing more liberal Jani Nikula
2013-10-17 8:11 ` Mark Walters
2013-10-17 11:52 ` Jani Nikula
2013-10-17 13:58 ` Moritz Wilhelmy
2013-10-17 14:03 ` Jani Nikula
2013-10-16 19:00 ` [PATCH 4/6] lib: replace the header parser with gmime Jani Nikula
2013-10-16 19:00 ` [PATCH 5/6] lib: parse messages only once Jani Nikula
2013-10-16 19:00 ` [PATCH 6/6] HACK: fix broken messages in the perf test corpus Jani Nikula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=af8381b86275c4be77cc8527a19d69efbd2e9423.1381948853.git.jani@nikula.org \
--to=jani@nikula.org \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).