X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fbrowse.c;h=65f94f22262dfcbb7adf6553bf7a204f9d0632cc;hp=68974a2cca3b762c511ad1b69de473d5466b4e11;hb=05a3bbbe420e4afc76e0eea24ce32f859405dc4a;hpb=ecaab35b973fbceb58b5ed174971c82762cc0199 diff --git a/imap/browse.c b/imap/browse.c index 68974a2..65f94f2 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -21,11 +21,12 @@ #include #include #include +#include + +#include -#include "lib/debug.h" #include "mutt.h" -#include "enter.h" #include "imap_private.h" /* -- forward declarations -- */ @@ -73,8 +74,8 @@ int imap_browse (char *path, struct browser_state *state) save_lsub = option (OPTIMAPCHECKSUBSCRIBED); unset_option (OPTIMAPCHECKSUBSCRIBED); - strfcpy (list_cmd, option (OPTIMAPLSUB) ? "LSUB" : "LIST", - sizeof (list_cmd)); + m_strcpy(list_cmd, sizeof(list_cmd), + option(OPTIMAPLSUB) ? "LSUB" : "LIST"); if (!(idata = imap_conn_find (&(mx.account), 0))) goto fail; @@ -101,8 +102,7 @@ int imap_browse (char *path, struct browser_state *state) 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 */ - mbox[sizeof (mbox) - 1] = '\0'; - strncpy (mbox, buf, sizeof (mbox) - 1); + m_strcpy(mbox, sizeof(mbox), buf); n = m_strlen(mbox); debug_print (3, ("mbox: %s\n", mbox)); @@ -260,7 +260,7 @@ int imap_mailbox_create (const char *folder) goto fail; } - strfcpy (buf, NONULL (mx.mbox), sizeof (buf)); + m_strcpy(buf, sizeof(buf), NONULL(mx.mbox)); /* append a delimiter if necessary */ n = m_strlen(buf); @@ -366,7 +366,7 @@ static int browse_add_list_result (IMAP_DATA * idata, const char *cmd, if (isparent) noselect = 1; /* prune current folder from output */ - if (isparent || str_ncmp (name, mx.mbox, m_strlen(name))) + if (isparent || m_strncmp(name, mx.mbox, m_strlen(name))) imap_add_folder (idata->delim, name, noselect, noinferiors, state, isparent); } @@ -400,12 +400,12 @@ static void imap_add_folder (char delim, char *folder, int noselect, /* render superiors as unix-standard ".." */ if (isparent) - strfcpy (relpath, "../", sizeof (relpath)); + m_strcpy(relpath, sizeof(relpath), "../"); /* strip current folder from target, to render a relative path */ - else if (!str_ncmp (mx.mbox, folder, m_strlen(mx.mbox))) - strfcpy (relpath, folder + m_strlen(mx.mbox), sizeof (relpath)); + else if (!m_strncmp(mx.mbox, folder, m_strlen(mx.mbox))) + m_strcpy(relpath, sizeof(relpath), folder + m_strlen(mx.mbox)); else - strfcpy (relpath, folder, sizeof (relpath)); + m_strcpy(relpath, sizeof(relpath), folder); /* apply filemask filter. This should really be done at menu setup rather * than at scan, since it's so expensive to scan. But that's big changes @@ -440,7 +440,7 @@ static void imap_add_folder (char delim, char *folder, int noselect, static int compare_names (struct folder_file *a, struct folder_file *b) { - return str_cmp (a->name, b->name); + return m_strcmp(a->name, b->name); } static int browse_get_namespace (IMAP_DATA * idata, char *nsbuf, int nsblen,