fseek(mail_file, current_position_in_mail, SEEK_SET);
if(fgets(raw_mbox_line, BUFFER_SIZE, mail_file)) {
- last_mbox_line_was_empty = 1;
+ last_mbox_line_was_empty = 0;
fprintf(output_file, "%s", raw_mbox_line);
while(1) {
if(!fgets(raw_mbox_line, BUFFER_SIZE, mail_file) ||
search_conditions[n].negation = 0;
}
- if(strcmp(search_field, "today") == 0) {
+ if(strcmp(search_field, "6h") == 0) {
+ search_conditions[n].field_id = ID_INTERVAL;
+ search_conditions[n].interval_start = time(0) - 3600 * 6;
+ search_conditions[n].interval_stop = 0;
+ }
+
+ else if(strcmp(search_field, "24h") == 0 ||
+ strcmp(search_field, "today") == 0) {
search_conditions[n].field_id = ID_INTERVAL;
search_conditions[n].interval_start = time(0) - 3600 * 24;
search_conditions[n].interval_stop = 0;
}
for(n = 0; n < nb_search_conditions; n++) {
- regfree(&search_conditions[n].regexp);
+ if(search_conditions[n].field_id != ID_INTERVAL) {
+ regfree(&search_conditions[n].regexp);
+ }
free(search_condition_strings[n]);
}
}