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); |
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 |
|
|