221 |
unsigned int i = 0; |
unsigned int i = 0; |
222 |
char *tok; |
char *tok; |
223 |
|
|
224 |
while (i < MBOXGRP_MBOXES_MAX - 1 && (tok = strsep(&mboxs, ","))) { |
tok = strtok_r(mboxs, ",", &mboxs); |
225 |
|
while (i < MBOXGRP_MBOXES_MAX - 1 && tok) { |
226 |
node->mboxes[i] = (mbox_t *) set_mbox(tok); |
node->mboxes[i] = (mbox_t *) set_mbox(tok); |
227 |
node->mboxes[++i] = NULL; |
node->mboxes[++i] = NULL; |
228 |
|
|
229 |
|
tok = strtok_r(NULL, ",", &mboxs); |
230 |
} |
} |
231 |
} |
} |
232 |
|
|
437 |
|
|
438 |
c = cp = (char *)malloc(match[9].rm_eo - match[9].rm_so + 1); |
c = cp = (char *)malloc(match[9].rm_eo - match[9].rm_so + 1); |
439 |
xstrncpy(c, line + match[9].rm_so, match[9].rm_eo - match[9].rm_so); |
xstrncpy(c, line + match[9].rm_so, match[9].rm_eo - match[9].rm_so); |
440 |
while ((t = strsep(&c, ","))) { |
|
441 |
|
t = strtok_r(c, ",", &c); |
442 |
|
while (t) { |
443 |
if (!strcasecmp(t, "none")) { |
if (!strcasecmp(t, "none")) { |
444 |
if (match[9].rm_eo - match[9].rm_so != strlen("none")) |
if (match[9].rm_eo - match[9].rm_so != strlen("none")) |
445 |
return ERROR_CONFIG_PARSE; |
return ERROR_CONFIG_PARSE; |
455 |
cur_fltr->action.msgflags |= MESSAGE_FLAG_DRAFT; |
cur_fltr->action.msgflags |= MESSAGE_FLAG_DRAFT; |
456 |
else |
else |
457 |
return ERROR_CONFIG_PARSE; |
return ERROR_CONFIG_PARSE; |
458 |
|
|
459 |
|
t = strtok_r(NULL, ",", &c); |
460 |
} |
} |
461 |
xfree(cp); |
xfree(cp); |
462 |
} else if (!strncasecmp(line + match[1].rm_so, "list", 4)) { |
} else if (!strncasecmp(line + match[1].rm_so, "list", 4)) { |
687 |
mbgrp = (char *)xmalloc(n + 1); |
mbgrp = (char *)xmalloc(n + 1); |
688 |
|
|
689 |
/* Go through filters. */ |
/* Go through filters. */ |
690 |
while ((ftok = strsep(&f, ","))) { |
ftok = strtok_r(f, ",", &f); |
691 |
|
while (ftok) { |
692 |
cf = (filter_t *) find_filter(ftok); |
cf = (filter_t *) find_filter(ftok); |
693 |
if (!cf) |
if (!cf) |
694 |
return ERROR_CONFIG_PARSE; |
return ERROR_CONFIG_PARSE; |
697 |
g[n] = 0; |
g[n] = 0; |
698 |
|
|
699 |
/* Go through mailbox groups. */ |
/* Go through mailbox groups. */ |
700 |
while ((gtok = strsep(&g, ","))) { |
gtok = strtok_r(g, ",", &g); |
701 |
|
while (gtok) { |
702 |
cg = (mboxgrp_t *) find_mboxgrp(gtok); |
cg = (mboxgrp_t *) find_mboxgrp(gtok); |
703 |
if (!cg) |
if (!cg) |
704 |
return ERROR_CONFIG_PARSE; |
return ERROR_CONFIG_PARSE; |
705 |
link_mbox_filter(cf, cg); |
link_mbox_filter(cf, cg); |
706 |
|
|
707 |
|
gtok = strtok_r(NULL, ",", &g); |
708 |
} |
} |
709 |
|
|
710 |
|
ftok = strtok_r(NULL, ",", &f); |
711 |
} |
} |
712 |
|
|
713 |
xfree(fltr); |
xfree(fltr); |
801 |
|
|
802 |
while (*c) { |
while (*c) { |
803 |
if (*c == '%') { |
if (*c == '%') { |
804 |
if (!isxdigit(*(c + 1)) || !isxdigit(*(c + 2))) |
if (!isxdigit((unsigned char)(*(c + 1))) || |
805 |
|
!isxdigit((unsigned char)(*(c + 2)))) |
806 |
return ERROR_CONFIG_PARSE; |
return ERROR_CONFIG_PARSE; |
807 |
|
|
808 |
xstrncpy(hex, ++c, 2); |
xstrncpy(hex, ++c, 2); |
809 |
hex[2] = 0; |
hex[2] = 0; |
810 |
|
|
811 |
if (!isprint(*str = (char)strtoul(hex, NULL, 16))) |
if (!isprint((unsigned char)(*str = (char)strtoul(hex, NULL, 16)))) |
812 |
return ERROR_CONFIG_PARSE; |
return ERROR_CONFIG_PARSE; |
813 |
|
|
814 |
str++; |
str++; |