mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
Set filaneme BEFORE we return from open_mailbox() if we don't have positive message count (Bug #5175)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3780,6 +3780,12 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu,int box)
|
||||
int count_msg, last_msg;
|
||||
|
||||
ast_copy_string(vms->curbox, mbox(box), sizeof(vms->curbox));
|
||||
|
||||
/* Rename the member vmbox HERE so that we don't try to return before
|
||||
* we know what's going on.
|
||||
*/
|
||||
snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", vms->curbox);
|
||||
|
||||
make_dir(vms->curdir, sizeof(vms->curdir), vmu->context, vms->username, vms->curbox);
|
||||
count_msg = count_messages(vmu, vms->curdir);
|
||||
if (count_msg < 0)
|
||||
@@ -3805,7 +3811,6 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu,int box)
|
||||
return res;
|
||||
}
|
||||
|
||||
snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", vms->curbox);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user