isync

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

commit e5d323cc47903e95eec7a104a3147bdcb8a7cc4b
parent 3169c59e10667dfc74ced116935b2f8f9c126e00
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Sun, 24 Jul 2011 20:27:09 +0200

rely on the maildir's existence with "SyncState *"

now that we open the box first, we know that it will exist at this
point.

Diffstat:
Msrc/sync.c | 20++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/sync.c b/src/sync.c @@ -621,17 +621,17 @@ box_selected( int sts, void *aux ) free( cmname ); } free( csname ); + if (!(s = strrchr( svars->dname, '/' ))) { + error( "Error: invalid SyncState '%s'\n", svars->dname ); + goto sbail; + } + *s = 0; + if (mkdir( svars->dname, 0700 ) && errno != EEXIST) { + error( "Error: cannot create SyncState directory '%s': %s\n", svars->dname, strerror(errno) ); + goto sbail; + } + *s = '/'; } - if (!(s = strrchr( svars->dname, '/' ))) { - error( "Error: invalid SyncState '%s'\n", svars->dname ); - goto sbail; - } - *s = 0; - if (mkdir( svars->dname, 0700 ) && errno != EEXIST) { - error( "Error: cannot create SyncState directory '%s': %s\n", svars->dname, strerror(errno) ); - goto sbail; - } - *s = '/'; nfasprintf( &svars->jname, "%s.journal", svars->dname ); nfasprintf( &svars->nname, "%s.new", svars->dname ); nfasprintf( &svars->lname, "%s.lock", svars->dname );