/*
* Copyright (C) 1996-9 Brandon Long <blong@fiction.net>
- * Copyright (C) 1999-2007 Brendan Cully <brendan@kublai.com>
+ * Copyright (C) 1999-2008 Brendan Cully <brendan@kublai.com>
*
* 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
if (mx.mbox && mx.mbox[0] != '\0')
{
int rc;
+ char *ptr;
imap_fix_path (idata, mx.mbox, mbox, sizeof (mbox));
- imap_munge_mbox_name (buf, sizeof (buf), mbox);
- imap_unquote_string(buf); /* As kludgy as it gets */
+ ptr = safe_strdup (mbox);
+ imap_utf7_encode (&ptr);
mbox[sizeof (mbox) - 1] = '\0';
- strncpy (mbox, buf, sizeof (mbox) - 1);
+ strncpy (mbox, ptr, sizeof (mbox) - 1);
+ FREE (&ptr);
n = mutt_strlen (mbox);
dprint (3, (debugfile, "imap_browse: mbox: %s\n", mbox));
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;
state->messages = status->messages;
}
+ FREE (&mx.mbox);
+
return 0;
}
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;