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

Diff of /imapfilter/data.c

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

revision 1.20 by lefcha, Mon Jan 14 18:12:38 2002 UTC revision 1.21 by lefcha, Fri Jan 25 17:10:17 2002 UTC
# Line 269  mbox_t *set_mbox(char *name) Line 269  mbox_t *set_mbox(char *name)
269    
270      init_mbox(node);      init_mbox(node);
271    
272      strncat(node->name, name, min(strlen(name), MBOX_NAME_LEN - 1));      if (*name == '"' && *(name + strlen(name) - 1) == '"')
273            strncat(node->name, name + 1, min(strlen(name) - 2, MBOX_NAME_LEN - 1));
274        else
275            strncat(node->name, name, min(strlen(name), MBOX_NAME_LEN - 1));
276    
277  #ifdef DEBUG  #ifdef DEBUG
278      printf("debug: MBOX: '%s'\n", node->name);      printf("debug: MBOX: '%s'\n", node->name);
# Line 369  int set_action(char *line, regmatch_t * Line 372  int set_action(char *line, regmatch_t *
372          cur_fltr->action.type = FILTER_ACTION_DELETE;          cur_fltr->action.type = FILTER_ACTION_DELETE;
373      else if (!strncasecmp(line + match[1].rm_so, "copy", 4)) {      else if (!strncasecmp(line + match[1].rm_so, "copy", 4)) {
374          cur_fltr->action.type = FILTER_ACTION_COPY;          cur_fltr->action.type = FILTER_ACTION_COPY;
375          strncat(cur_fltr->action.destmbox, line + match[2].rm_so,          if (*(line + match[2].rm_so) == '"' && *(line + match[2].rm_eo - 1) == '"')
376                  min(match[2].rm_eo - match[2].rm_so, MBOX_NAME_LEN - 1));              strncat(cur_fltr->action.destmbox, line + match[2].rm_so + 1,
377                        min(match[2].rm_eo - match[2].rm_so - 2, MBOX_NAME_LEN - 1));
378            else
379                strncat(cur_fltr->action.destmbox, line + match[2].rm_so,
380                        min(match[2].rm_eo - match[2].rm_so, MBOX_NAME_LEN - 1));
381      } else if (!strncasecmp(line + match[1].rm_so, "move", 4)) {      } else if (!strncasecmp(line + match[1].rm_so, "move", 4)) {
382          cur_fltr->action.type = FILTER_ACTION_MOVE;          cur_fltr->action.type = FILTER_ACTION_MOVE;
383          strncat(cur_fltr->action.destmbox, line + match[3].rm_so,          if (*(line + match[3].rm_so) == '"' && *(line + match[3].rm_eo - 1) == '"')
384                  min(match[3].rm_eo - match[3].rm_so, MBOX_NAME_LEN - 1));              strncat(cur_fltr->action.destmbox, line + match[3].rm_so + 1,
385                        min(match[3].rm_eo - match[3].rm_so - 2, MBOX_NAME_LEN - 1));
386            else
387                strncat(cur_fltr->action.destmbox, line + match[3].rm_so,
388                        min(match[3].rm_eo - match[3].rm_so, MBOX_NAME_LEN - 1));
389      } else if (!strncasecmp(line + match[1].rm_so, "list", 4))      } else if (!strncasecmp(line + match[1].rm_so, "list", 4))
390          cur_fltr->action.type = FILTER_ACTION_LIST;          cur_fltr->action.type = FILTER_ACTION_LIST;
391    

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26