/[imapfilter]/imapfilter/data.c
ViewVC logotype

Diff of /imapfilter/data.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by lefcha, Sat Nov 10 15:30:08 2001 UTC revision 1.18 by lefcha, Sat Nov 10 17:10:56 2001 UTC
# Line 454  int set_mask(char *line, regmatch_t * ma Line 454  int set_mask(char *line, regmatch_t * ma
454                  *(bp++) = '"';                  *(bp++) = '"';
455              *bp = 0;              *bp = 0;
456          }          }
457      if (f && (strstr(node->body, "OLDER") || strstr(node->body, "NEWER")))      if (f && (strstr(node->body, "OLDER") || strstr(node->body, "NEWER"))) {
458          convert_date(node);          convert_date(node);
459            bp = node->body + strlen(node->body);
460        }
461      append_mask(node);      append_mask(node);
462    
463      cur_fltr->masknum++;      cur_fltr->masknum++;
# Line 486  void convert_date(mask_t * node) Line 487  void convert_date(mask_t * node)
487      cp = xstrdup(node->body);      cp = xstrdup(node->body);
488      node->body[0] = 0;      node->body[0] = 0;
489    
490      if (strstr(cp, "OLDER"))      if (strstr(cp, "NOT"))
491            strncat(node->body, "NOT ", 4);
492    
493        if ((c = strstr(cp, "OLDER")))
494          strncat(node->body, "BEFORE ", 7);          strncat(node->body, "BEFORE ", 7);
495      else      else if ((c = strstr(cp, "NEWER")))
496          strncat(node->body, "SINCE ", 6);          strncat(node->body, "SINCE ", 6);
497    
498      c = strchr(cp, ' ');      c += 6;
499    
500      t = time(NULL) - (time_t) (strtoul(c, NULL, 10) * 24 * 60 * 60);      t = time(NULL) - (time_t) (strtoul(c, NULL, 10) * 24 * 60 * 60);
501      bt = localtime(&t);      bt = localtime(&t);
502    
503      if (strftime(s, 15, "%d-%b-%Y", bt))      if (strftime(s, 15, "%d-%b-%Y", bt))
504          strncat(node->body, s, 16);          strncat(node->body, s, 15);
505    
506      free(cp);      free(cp);
507  }  }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26