char *position_in_file_string;
char *mail_filename;
- for(n = 0; n < nb_search_patterns && hits[n]; n++);
+ for(n = 0; n < nb_search_patterns &&
+ ((hits[n] && !search_requests[n].negation) ||
+ (!hits[n] && search_requests[n].negation)); n++);
if(n == nb_search_patterns) {
FILE *mail_file;
for(n = 0; n < nb_search_patterns; n++) {
search_regexp_string = segment_next_field(search_pattern[n]);
+ if(search_pattern[n][0] == '!') {
+ search_pattern[n]++;
+ search_requests[n].negation = 1;
+ } else {
+ search_requests[n].negation = 0;
+ }
+
search_requests[n].field_id = -1;
for(m = 0; (m < MAX_ID) && search_requests[n].field_id == -1; m++) {
if(strncmp(field_names[m], search_pattern[n], strlen(search_pattern[n])) == 0) {