/**
* comp_path_canon - Canonicalise a mailbox path - Implements MxOps::path_canon()
*/
-int comp_path_canon(char *buf, size_t buflen, const char *folder)
+int comp_path_canon(char *buf, size_t buflen)
{
if (!buf)
return -1;
- if ((buf[0] == '+') || (buf[0] == '='))
- {
- if (!folder)
- return -1;
-
- buf[0] = '/';
- mutt_str_inline_replace(buf, buflen, 0, folder);
- }
-
mutt_path_canon(buf, buflen, HomeDir);
return 0;
}
/**
* imap_path_canon - Canonicalise a mailbox path - Implements MxOps::path_canon()
*/
-int imap_path_canon(char *buf, size_t buflen, const char *folder)
+int imap_path_canon(char *buf, size_t buflen)
{
if (!buf)
return -1;
-#if 0
- if ((buf[0] == '+') || (buf[0] == '='))
- {
- if (!folder)
- return -1;
-
- size_t flen = mutt_str_strlen(folder);
- if ((flen > 0) && (folder[flen - 1] != '/'))
- {
- buf[0] = '/';
- mutt_str_inline_replace(buf, buflen, 0, folder);
- }
- else
- {
- mutt_str_inline_replace(buf, buflen, 1, folder);
- }
- }
-#endif
-
struct Url url;
char tmp[PATH_MAX];
char tmp2[PATH_MAX];
int imap_complete(char *buf, size_t buflen, char *path);
int imap_fast_trash(struct Mailbox *m, char *dest);
int imap_path_probe(const char *path, const struct stat *st);
-int imap_path_canon(char *buf, size_t buflen, const char *folder);
+int imap_path_canon(char *buf, size_t buflen);
extern struct MxOps mx_imap_ops;
/**
* maildir_path_canon - Canonicalise a mailbox path - Implements MxOps::path_canon()
*/
-int maildir_path_canon(char *buf, size_t buflen, const char *folder)
+int maildir_path_canon(char *buf, size_t buflen)
{
if (!buf)
return -1;
- if ((buf[0] == '+') || (buf[0] == '='))
- {
- if (!folder)
- return -1;
-
- buf[0] = '/';
- mutt_str_inline_replace(buf, buflen, 0, folder);
- }
-
mutt_path_canon(buf, buflen, HomeDir);
return 0;
}
/**
* mbox_path_canon - Canonicalise a mailbox path - Implements MxOps::path_canon()
*/
-int mbox_path_canon(char *buf, size_t buflen, const char *folder)
+int mbox_path_canon(char *buf, size_t buflen)
{
if (!buf)
return -1;
- if ((buf[0] == '+') || (buf[0] == '='))
- {
- if (!folder)
- return -1;
-
- buf[0] = '/';
- mutt_str_inline_replace(buf, buflen, 0, folder);
- }
-
mutt_path_canon(buf, buflen, HomeDir);
return 0;
}
/* Rewrite IMAP path in canonical form - aids in string comparisons of
* folders. May possibly fail, in which case buf should be the same. */
if (imap_path_probe(buf, NULL) == MUTT_IMAP)
- imap_path_canon(buf, buflen, NULL);
+ imap_path_canon(buf, buflen);
#endif
return buf;
if (!ops || !ops->path_canon)
return -1;
- if (ops->path_canon(buf, buflen, folder) < 0)
+ if (ops->path_canon(buf, buflen) < 0)
{
mutt_path_canon(buf, buflen, HomeDir);
}
if (!ops->path_canon)
return -1;
- if (ops->path_canon(buf, buflen, folder) < 0)
+ if (ops->path_canon(buf, buflen) < 0)
return -1;
if (!ops->path_pretty)
* path_canon - Canonicalise a mailbox path
* @param buf Path to modify
* @param buflen Length of buffer
- * @param folder Base path for '=' substitution
* @retval 0 Success
* @retval -1 Failure
*/
- int (*path_canon) (char *buf, size_t buflen, const char *folder);
+ int (*path_canon) (char *buf, size_t buflen);
/**
* path_pretty - Abbreviate a mailbox path
* @param buf Path to modify
/**
* nntp_path_canon - Canonicalise a mailbox path - Implements MxOps::path_canon()
*/
-int nntp_path_canon(char *buf, size_t buflen, const char *folder)
+int nntp_path_canon(char *buf, size_t buflen)
{
if (!buf)
return -1;
- if ((buf[0] == '+') || (buf[0] == '='))
- {
- if (!folder)
- return -1;
-
- size_t flen = mutt_str_strlen(folder);
- if ((flen > 0) && (folder[flen - 1] != '/'))
- {
- buf[0] = '/';
- mutt_str_inline_replace(buf, buflen, 0, folder);
- }
- else
- {
- mutt_str_inline_replace(buf, buflen, 1, folder);
- }
- }
-
return 0;
}
/**
* nm_path_canon - Canonicalise a mailbox path - Implements MxOps::path_canon()
*/
-int nm_path_canon(char *buf, size_t buflen, const char *folder)
+int nm_path_canon(char *buf, size_t buflen)
{
if (!buf)
return -1;
- if ((buf[0] == '+') || (buf[0] == '='))
- {
- if (!folder)
- return -1;
-
- size_t flen = mutt_str_strlen(folder);
- if ((flen > 0) && (folder[flen - 1] != '/'))
- {
- buf[0] = '/';
- mutt_str_inline_replace(buf, buflen, 0, folder);
- }
- else
- {
- mutt_str_inline_replace(buf, buflen, 1, folder);
- }
- }
-
return 0;
}
/**
* pop_path_canon - Canonicalise a mailbox path - Implements MxOps::path_canon()
*/
-int pop_path_canon(char *buf, size_t buflen, const char *folder)
+int pop_path_canon(char *buf, size_t buflen)
{
if (!buf)
return -1;
- if ((buf[0] == '+') || (buf[0] == '='))
- {
- if (!folder)
- return -1;
-
- size_t flen = mutt_str_strlen(folder);
- if ((flen > 0) && (folder[flen - 1] != '/'))
- {
- buf[0] = '/';
- mutt_str_inline_replace(buf, buflen, 0, folder);
- }
- else
- {
- mutt_str_inline_replace(buf, buflen, 1, folder);
- }
- }
-
return 0;
}