X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fbrowse.c;h=2cc16f8fa926f1bd5ca58068efa8d64d1e405480;hp=9025dab31df410d02c0690c8eb8dfa2f623b246e;hb=ac813896ca32d850febc2d95065ac4fa040f11f9;hpb=c98480f8568e6c1bc927c6c5f2b5e80b4aa6548c diff --git a/imap/browse.c b/imap/browse.c index 9025dab..2cc16f8 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" : "string_list_t"); if (!(idata = imap_conn_find (&(mx.account), 0))) goto fail; @@ -194,7 +195,7 @@ int imap_browse (char *path, struct browser_state *state) * namespace is not "", so we have to list it explicitly. We ask the * server to see if it has descendants. */ debug_print (3, ("adding INBOX\n")); - if (browse_add_list_result (idata, "LIST \"\" \"INBOX\"", state, 0)) + if (browse_add_list_result (idata, "string_list_t \"\" \"INBOX\"", state, 0)) goto fail; } @@ -259,11 +260,11 @@ 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); - if (n && (n < sizeof (buf) - 1) && (buf[n - 1] != idata->delim)) { + if (n && (n < ssizeof (buf) - 1) && (buf[n - 1] != idata->delim)) { buf[n++] = idata->delim; buf[n] = '\0'; } @@ -399,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 (!m_strncmp(mx.mbox, folder, m_strlen(mx.mbox))) - strfcpy (relpath, folder + m_strlen(mx.mbox), sizeof (relpath)); + 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 @@ -418,7 +419,7 @@ static void imap_add_folder (char delim, char *folder, int noselect, (state->entry)[state->entrylen].name = m_strdup(tmp); /* mark desc with delim in browser if it can have subfolders */ - if (!isparent && !noinferiors && m_strlen(relpath) < sizeof (relpath) - 1) { + if (!isparent && !noinferiors && m_strlen(relpath) < ssizeof (relpath) - 1) { relpath[m_strlen(relpath) + 1] = '\0'; relpath[m_strlen(relpath)] = delim; } @@ -552,11 +553,11 @@ static int browse_verify_namespace (IMAP_DATA * idata, * than invisible namespaces */ if (nsi->delim) snprintf (buf, sizeof (buf), "%s \"\" \"%s%c%%\"", - option (OPTIMAPLSUB) ? "LSUB" : "LIST", nsi->prefix, + option (OPTIMAPLSUB) ? "LSUB" : "string_list_t", nsi->prefix, nsi->delim); else snprintf (buf, sizeof (buf), "%s \"\" \"%s%%\"", - option (OPTIMAPLSUB) ? "LSUB" : "LIST", nsi->prefix); + option (OPTIMAPLSUB) ? "LSUB" : "string_list_t", nsi->prefix); imap_cmd_start (idata, buf);