isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit e0d72cd5e3cb3a6d10cc7766e3f9e53b21d7a17e
parent 6985da584857b30a34dd1bc2d4792ed0e5b0b1dc
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Sat, 18 Nov 2006 13:17:13 +0000

reverse-map <Inbox> to INBOX when encountered during listing.
usually this will be a no-op (when putting INBOX in Path, people
generally call it INBOX), but better safe than sorry.

Diffstat:
Msrc/drv_maildir.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/drv_maildir.c b/src/drv_maildir.c @@ -174,15 +174,18 @@ maildir_list( store_t *gctx, return; } while ((de = readdir( dir ))) { + const char *inbox = ((maildir_store_conf_t *)gctx->conf)->inbox; + int bl; struct stat st; char buf[PATH_MAX]; if (*de->d_name == '.') continue; - nfsnprintf( buf, sizeof(buf), "%s%s/cur", gctx->conf->path, de->d_name ); + bl = nfsnprintf( buf, sizeof(buf), "%s%s/cur", gctx->conf->path, de->d_name ); if (stat( buf, &st ) || !S_ISDIR(st.st_mode)) continue; - add_string_list( &gctx->boxes, de->d_name ); + add_string_list( &gctx->boxes, + !memcmp( buf, inbox, bl - 4 ) && !inbox[bl - 4] ? "INBOX" : de->d_name ); } closedir (dir); gctx->listed = 1;