Commit 0e679bef authored by Raphaël Hertzog's avatar Raphaël Hertzog Committed by Kim Vandry

Fix search of message id containing equal signs

Mairix incorrectly interprets the equal sign as a substring search
even when the following character is not compatible with such
a search.

All gmail Message-ID have an equal sign so this is major problem
when you want to lookup a specific Message-ID.

Fixes rc0/mairix#10
parent 98206c33
...@@ -1014,11 +1014,12 @@ static int do_search(struct read_db *db, char **args, char *output_path, int sho ...@@ -1014,11 +1014,12 @@ static int do_search(struct read_db *db, char **args, char *output_path, int sho
} }
equal = strchr(word, '='); equal = strchr(word, '=');
if (equal) { if (equal && (equal[1] == '\0' || isdigit(equal[1]))) {
*equal = 0; *equal = 0;
max_errors = atoi(equal + 1); max_errors = atoi(equal + 1);
/* Extend this to do anchoring etc */ /* Extend this to do anchoring etc */
} else { } else {
equal = NULL;
max_errors = 0; /* keep GCC quiet */ max_errors = 0; /* keep GCC quiet */
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment