From 7d48ed53a78ec5a53eef1cb2b659e49a2747f5e3 Mon Sep 17 00:00:00 2001 From: djcb Date: Sun, 28 Apr 2013 21:54:25 +0300 Subject: [PATCH] * mu: (re)add special handling for '$' (fixes #193) --- lib/mu-str.c | 2 ++ lib/tests/test-mu-str.c | 2 +- lib/tests/testdir/cur/1283599333.1840_11.cthulhu!2, | 1 + mu/tests/test-mu-query.c | 4 +++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/mu-str.c b/lib/mu-str.c index 9f5d675a..276f0557 100644 --- a/lib/mu-str.c +++ b/lib/mu-str.c @@ -467,6 +467,7 @@ is_xapian_special_char (char c) case ':': case '(': case ')': + case '$': case '"': case '\\': case '\'': @@ -534,6 +535,7 @@ mu_str_xapian_escape_in_place_try (char *term, gboolean esc_space, GStringChunk case '[': case ']': case '+': + case '$': case '\\': case '-': *cur = ESC_CHAR; diff --git a/lib/tests/test-mu-str.c b/lib/tests/test-mu-str.c index 680423b0..fa41ff53 100644 --- a/lib/tests/test-mu-str.c +++ b/lib/tests/test-mu-str.c @@ -200,7 +200,7 @@ test_mu_str_xapian_escape (void) { "Foo. Bar", "foo bar" }, { "subject:test@foo", "subject:test_foo" }, { "xxx:test@bar", "xxx test_bar" }, - { "aa$bb$cc", "aa bb cc" }, + { "aa$bb$cc", "aa_bb_cc" }, { "date:2010..2012", "date:2010..2012"}, { "d:2010..2012", "d:2010..2012"}, { "size:10..20", "size:10..20"}, diff --git a/lib/tests/testdir/cur/1283599333.1840_11.cthulhu!2, b/lib/tests/testdir/cur/1283599333.1840_11.cthulhu!2, index 8349c3e2..25c7180d 100644 --- a/lib/tests/testdir/cur/1283599333.1840_11.cthulhu!2, +++ b/lib/tests/testdir/cur/1283599333.1840_11.cthulhu!2, @@ -7,6 +7,7 @@ Organization: The Fellowship of the Ring MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +Message-Id: Let's write some fünkÿ text diff --git a/mu/tests/test-mu-query.c b/mu/tests/test-mu-query.c index e76070ed..5c090bc2 100644 --- a/mu/tests/test-mu-query.c +++ b/mu/tests/test-mu-query.c @@ -176,7 +176,9 @@ test_mu_query_01 (void) { "foo:pepernoot", 0 }, { "funky", 1 }, { "fünkÿ", 1 }, - { "", 18 } + { "", 18 }, + { "msgid:abcd$efgh@example.com", 1}, + { "i:abcd$efgh@example.com", 1}, }; for (i = 0; i != G_N_ELEMENTS(queries); ++i)