/* general IMAP utility functions */
+#include "config.h"
+
#include "mutt.h"
#include "mx.h" /* for M_IMAP */
#include "url.h"
}
if (n > 1) {
- if (sscanf (tmp, ":%hd%127s", &(mx->account.port), tmp) >= 1)
+ if (sscanf (tmp, ":%hu%127s", &(mx->account.port), tmp) >= 1)
mx->account.flags |= M_ACCT_PORT;
if (sscanf (tmp, "/%s", tmp) == 1)
{
}
}
-#ifdef USE_SSL
+#if defined(USE_SSL) || defined(USE_GNUTLS)
if (option (OPTIMAPFORCESSL))
mx->account.flags |= M_ACCT_SSL;
#endif
* in IMAP. Additionally, the filesystem converts multiple hierarchy
* delimiters into a single one, ie "///" is equal to "/". IMAP servers
* 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,
size_t plen)
}
x++;
}
+ if (x && path[--x] != idata->delim)
+ x++;
path[x] = '\0';
return path;
}