X-Git-Url: https://git.llucax.com/software/mutt-debian.git/blobdiff_plain/14c29200cb58d3c4a0830265f2433849781858d0..5ae55757749249636c92aa7e3ddc2f7e83b52eb0:/imap/browse.c?ds=inline diff --git a/imap/browse.c b/imap/browse.c index 750a65d..0262e2f 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -1,6 +1,6 @@ /* * Copyright (C) 1996-9 Brandon Long - * Copyright (C) 1999-2007 Brendan Cully + * Copyright (C) 1999-2008 Brendan Cully * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -228,7 +228,7 @@ int imap_mailbox_state (const char* path, struct mailbox_state* state) return -1; } - if (!imap_mxcmp(mx.mbox, idata->mailbox)) + if (idata->ctx && !imap_mxcmp(mx.mbox, idata->mailbox)) { state->new = idata->ctx->new; state->messages = idata->ctx->msgcount; @@ -239,6 +239,8 @@ int imap_mailbox_state (const char* path, struct mailbox_state* state) state->messages = status->messages; } + FREE (&mx.mbox); + return 0; } @@ -329,7 +331,9 @@ int imap_mailbox_rename(const char* mailbox) goto fail; } - if (imap_rename_mailbox (idata, &mx, newname) < 0) { + imap_fix_path (idata, newname, buf, sizeof (buf)); + + if (imap_rename_mailbox (idata, &mx, buf) < 0) { mutt_error (_("Rename failed: %s"), imap_get_qualifier (idata->buf)); mutt_sleep (1); goto fail;