* fix matching backslashes, add some tests

This commit is contained in:
djcb 2013-05-27 05:49:43 -07:00
parent bdf7ca65c7
commit e97ec2d51c
4 changed files with 6 additions and 0 deletions

View File

@ -303,6 +303,8 @@ mu_str_esc_to_list (const char *strings)
kar = strings[u];
if (kar == '\\') {
if (escaped)
g_string_append_c (part, '\\');
escaped = !escaped;
continue;
}

View File

@ -198,6 +198,7 @@ test_mu_str_process_query_term (void)
{ "Foo..Bar", "foo..bar" },
{ "Foo.Bar", "foo_bar" },
{ "Foo Bar", "foo_bar" },
{ "\\foo", "_foo" },
{ "subject:test@foo", "subject:test_foo" },
{ "xxx:test@bar", "xxx:test_bar" },
{ "aa$bb$cc", "aa_bb_cc" },
@ -239,6 +240,7 @@ test_mu_str_process_term (void)
{ "Foo..Bar", "foo__bar" },
{ "Foo.Bar", "foo_bar" },
{ "Foo Bar", "foo_bar" },
{ "\\foo", "_foo" },
{ "subject:test@foo", "subject_test_foo" },
{ "xxx:test@bar", "xxx_test_bar" },
{ "aa$bb$cc", "aa_bb_cc" },

View File

@ -13,6 +13,7 @@ Organization: http://freemail.web.de/
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by mailhost6.ladot.com id j48MScQ30791
X-Label: \backslash
X-UIDL: 93h!!\i<!!L)l!!%_I!!
X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on mindcrime
X-Spam-Level:

View File

@ -559,6 +559,7 @@ test_mu_query_tags (void)
{ "tag:lost OR tag:horizon", 1},
{ "x:paradise,lost", 0},
{ "x:paradise AND x:lost", 1},
{ "x:\\\\backslash", 1},
};
for (i = 0; i != G_N_ELEMENTS(queries); ++i)