Browse Source

fix implicit listing of Maildir INBOX under Path

commit acd6b4b0 ("simplify/fix recursive maildir listing") argued that
listing INBOX when it is encountered while listing Path would be
unnecessary, as the caller would list it separately anyway if requested.
however, it is actually documented that Patterns will implicitly match
INBOX nested into Path. so revert that commit.

REFMAIL: 20240818002409.4c918eb4@inari
master
Oswald Buddenhagen 4 months ago
parent
commit
8c781d4fb5
  1. 6
      src/drv_maildir.c

6
src/drv_maildir.c

@ -372,6 +372,8 @@ maildir_list_maildirpp( maildir_store_t *ctx, int flags, const char *inbox )
return 0; return 0;
} }
static int maildir_list_inbox( maildir_store_t *ctx );
static int static int
maildir_list_recurse( maildir_store_t *ctx, int isBox, maildir_list_recurse( maildir_store_t *ctx, int isBox,
const char *inbox, uint inboxLen, const char *inbox, uint inboxLen,
@ -422,6 +424,10 @@ maildir_list_recurse( maildir_store_t *ctx, int isBox,
pl += pathLen; pl += pathLen;
if (inbox && equals( path, pl, inbox, inboxLen )) { if (inbox && equals( path, pl, inbox, inboxLen )) {
// Inbox nested into Path. // Inbox nested into Path.
if (maildir_list_inbox( ctx ) < 0) {
closedir( dir );
return -1;
}
} else { } else {
if (style == SUB_LEGACY) { if (style == SUB_LEGACY) {
if (*ent == '.') { if (*ent == '.') {

Loading…
Cancel
Save