avoid crash in case of a rather weird (==misconfigured?) sync state

location.
This commit is contained in:
Oswald Buddenhagen 2007-04-04 17:55:13 +00:00
parent 0eb399c672
commit 0d27c5f4cb

View File

@ -711,10 +711,11 @@ sync_boxes( store_t *mctx, const char *mname,
goto bail; goto bail;
} }
s = strrchr( dname, '/' ); if ((s = strrchr( dname, '/' ))) {
*s = 0; *s = 0;
mkdir( dname, 0700 ); mkdir( dname, 0700 );
*s = '/'; *s = '/';
}
if (lfd < 0) { if (lfd < 0) {
if ((lfd = open( lname, O_WRONLY|O_CREAT, 0666 )) < 0) if ((lfd = open( lname, O_WRONLY|O_CREAT, 0666 )) < 0)
goto lferr; goto lferr;