aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--notmuch-search.c4
-rwxr-xr-xtest/T090-search-output.sh2
2 files changed, 4 insertions, 2 deletions
diff --git a/notmuch-search.c b/notmuch-search.c
index 91b5d105..0262eb30 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -41,7 +41,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 == '\n')
+ *loop = ' ';
+ else if ((unsigned char)(*loop) < 32)
*loop = '?';
}
return out;
diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh
index 5ccfeaf9..86544ac9 100755
--- a/test/T090-search-output.sh
+++ b/test/T090-search-output.sh
@@ -388,7 +388,7 @@ add_message "[subject]='two =?ISO-8859-1?Q?line=0A_subject?=
headers'"
notmuch search id:"$gen_msg_id" | notmuch_search_sanitize >OUTPUT
cat <<EOF >EXPECTED
-thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; two line? subject headers (inbox unread)
+thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; two line subject headers (inbox unread)
EOF
test_expect_equal_file OUTPUT EXPECTED