Browse Source

try harder to list all necessary boxes

the pattern "INB*" may or may not refer to something in the INBOX. even
just "*" may. so list both the INBOX and the Path in case of
uncertainty.
wip/maildir-uid-dupes-test
Oswald Buddenhagen 12 years ago
parent
commit
66895f9cce
  1. 22
      src/main.c

22
src/main.c

@ -702,8 +702,26 @@ store_opened( store_t *ctx, void *aux )
if (!mvars->skip && !mvars->boxlist && mvars->chan->patterns && !ctx->listed) { if (!mvars->skip && !mvars->boxlist && mvars->chan->patterns && !ctx->listed) {
for (flags = 0, cpat = mvars->chan->patterns; cpat; cpat = cpat->next) { for (flags = 0, cpat = mvars->chan->patterns; cpat; cpat = cpat->next) {
const char *pat = cpat->string; const char *pat = cpat->string;
if (*pat != '!') if (*pat != '!') {
flags |= (!memcmp( pat, "INBOX", 5 ) && (!pat[5] || pat[5] == '/')) ? LIST_INBOX : LIST_PATH; int i;
char c;
static const char strinbox[] = "INBOX";
for (i = 0; ; i++) {
c = pat[i];
if (i == sizeof(strinbox) - 1)
break;
if (c != strinbox[i])
goto nextpat;
}
if (!c || c == '/') {
flags |= LIST_INBOX;
} else {
nextpat:
flags |= LIST_PATH;
if (c == '*' || c == '%')
flags |= LIST_INBOX;
}
}
} }
set_bad_callback( ctx, store_bad, AUX ); set_bad_callback( ctx, store_bad, AUX );
mvars->drv[t]->list( ctx, flags, store_listed, AUX ); mvars->drv[t]->list( ctx, flags, store_listed, AUX );

Loading…
Cancel
Save