void imap_error (const char* where, const char* msg);
IMAP_DATA* imap_new_idata (void);
void imap_free_idata (IMAP_DATA** idata);
-char* imap_fix_path (IMAP_DATA* idata, char* mailbox, char* path,
+char* imap_fix_path (IMAP_DATA* idata, const char* mailbox, char* path,
size_t plen);
void imap_cachepath(IMAP_DATA* idata, const char* mailbox, char* dest,
size_t dlen);
/* silly helper for mailbox name string comparisons, because of INBOX */
int imap_mxcmp (const char* mx1, const char* mx2)
{
+ char* b1;
+ char* b2;
+ int rc;
+
if (!ascii_strcasecmp (mx1, "INBOX") && !ascii_strcasecmp (mx2, "INBOX"))
return 0;
-
- return mutt_strcmp (mx1, mx2);
+
+ b1 = safe_malloc (strlen (mx1) + 1);
+ b2 = safe_malloc (strlen (mx2) + 1);
+
+ imap_fix_path (NULL, mx1, b1, strlen (mx1) + 1);
+ imap_fix_path (NULL, mx2, b2, strlen (mx2) + 1);
+
+ rc = mutt_strcmp (b1, b2);
+ FREE (&b1);
+ FREE (&b2);
+
+ return rc;
}
/* imap_pretty_mailbox: called by mutt_pretty_mailbox to make IMAP paths
* are not required to do this.
* Moreover, IMAP servers may dislike the path ending with the delimiter.
*/
-char *imap_fix_path (IMAP_DATA *idata, char *mailbox, char *path,
+char *imap_fix_path (IMAP_DATA *idata, const char *mailbox, char *path,
size_t plen)
{
int i = 0;