X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fbrowse.c;h=d9bdf83ddca6d6f85d90ee6dac875fced3021bc6;hp=52dcc799f166037c612cd494d5fc20914605add5;hb=0c12d960399d14b4143b2bb91a96bdaca64e4c56;hpb=617e7d83d14e14e6a520a48e75437211b16c8834 diff --git a/imap/browse.c b/imap/browse.c index 52dcc79..d9bdf83 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -18,13 +18,13 @@ #include #include +#include +#include +#include -#include "lib/str.h" -#include "lib/intl.h" #include "lib/debug.h" #include "mutt.h" -#include "ascii.h" #include "enter.h" #include "imap_private.h" @@ -82,7 +82,7 @@ int imap_browse (char *path, struct browser_state *state) if (!mx.mbox) { home_namespace = 1; mbox[0] = '\0'; /* Do not replace "" with "INBOX" here */ - mx.mbox = str_dup (ImapHomeNamespace); + mx.mbox = m_strdup(ImapHomeNamespace); if (mutt_bit_isset (idata->capabilities, NAMESPACE)) { mutt_message _("Getting namespaces..."); @@ -103,7 +103,7 @@ int imap_browse (char *path, struct browser_state *state) imap_unquote_string (buf); /* As kludgy as it gets */ mbox[sizeof (mbox) - 1] = '\0'; strncpy (mbox, buf, sizeof (mbox) - 1); - n = str_len (mbox); + n = m_strlen(mbox); debug_print (3, ("mbox: %s\n", mbox)); @@ -121,7 +121,7 @@ int imap_browse (char *path, struct browser_state *state) imap_unmunge_mbox_name (cur_folder); if (!noinferiors && cur_folder[0] && - (n = str_len (mbox)) < LONG_STRING - 1) { + (n = m_strlen(mbox)) < LONG_STRING - 1) { mbox[n++] = idata->delim; mbox[n] = '\0'; } @@ -136,7 +136,7 @@ int imap_browse (char *path, struct browser_state *state) if (!home_namespace) showparents = 1; imap_qualify_path (buf, sizeof (buf), &mx, mbox); - state->folder = str_dup (buf); + state->folder = m_strdup(buf); n--; } @@ -165,7 +165,7 @@ int imap_browse (char *path, struct browser_state *state) ctmp = mbox[n]; mbox[n] = '\0'; imap_qualify_path (buf, sizeof (buf), &mx, mbox); - state->folder = str_dup (buf); + state->folder = m_strdup(buf); } mbox[n] = ctmp; } @@ -179,7 +179,7 @@ int imap_browse (char *path, struct browser_state *state) imap_add_folder (idata->delim, relpath, 1, 0, state, 1); if (!state->folder) { imap_qualify_path (buf, sizeof (buf), &mx, relpath); - state->folder = str_dup (buf); + state->folder = m_strdup(buf); } } } @@ -187,7 +187,7 @@ int imap_browse (char *path, struct browser_state *state) /* no namespace, no folder: set folder to host only */ if (!state->folder) { imap_qualify_path (buf, sizeof (buf), &mx, NULL); - state->folder = str_dup (buf); + state->folder = m_strdup(buf); } if (home_namespace && mbox[0] != '\0') { @@ -263,7 +263,7 @@ int imap_mailbox_create (const char *folder) strfcpy (buf, NONULL (mx.mbox), sizeof (buf)); /* append a delimiter if necessary */ - n = str_len (buf); + n = m_strlen(buf); if (n && (n < sizeof (buf) - 1) && (buf[n - 1] != idata->delim)) { buf[n++] = idata->delim; buf[n] = '\0'; @@ -272,7 +272,7 @@ int imap_mailbox_create (const char *folder) if (mutt_get_field (_("Create mailbox: "), buf, sizeof (buf), M_FILE) < 0) goto fail; - if (!str_len (buf)) { + if (!m_strlen(buf)) { mutt_error (_("Mailbox must have a name.")); mutt_sleep (1); goto fail; @@ -315,7 +315,7 @@ int imap_mailbox_rename (const char *mailbox) if (mutt_get_field (buf, newname, sizeof (newname), M_FILE) < 0) goto fail; - if (!str_len (newname)) { + if (!m_strlen(newname)) { mutt_error (_("Mailbox must have a name.")); mutt_sleep (1); goto fail; @@ -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, str_len (name))) + if (isparent || str_ncmp (name, mx.mbox, m_strlen(name))) imap_add_folder (idata->delim, name, noselect, noinferiors, state, isparent); } @@ -402,8 +402,8 @@ static void imap_add_folder (char delim, char *folder, int noselect, if (isparent) strfcpy (relpath, "../", sizeof (relpath)); /* strip current folder from target, to render a relative path */ - else if (!str_ncmp (mx.mbox, folder, str_len (mx.mbox))) - strfcpy (relpath, folder + str_len (mx.mbox), sizeof (relpath)); + else if (!str_ncmp (mx.mbox, folder, m_strlen(mx.mbox))) + strfcpy (relpath, folder + m_strlen(mx.mbox), sizeof (relpath)); else strfcpy (relpath, folder, sizeof (relpath)); @@ -416,15 +416,15 @@ static void imap_add_folder (char delim, char *folder, int noselect, } imap_qualify_path (tmp, sizeof (tmp), &mx, folder); - (state->entry)[state->entrylen].name = str_dup (tmp); + (state->entry)[state->entrylen].name = m_strdup(tmp); /* mark desc with delim in browser if it can have subfolders */ - if (!isparent && !noinferiors && str_len (relpath) < sizeof (relpath) - 1) { - relpath[str_len (relpath) + 1] = '\0'; - relpath[str_len (relpath)] = delim; + if (!isparent && !noinferiors && m_strlen(relpath) < sizeof (relpath) - 1) { + relpath[m_strlen(relpath) + 1] = '\0'; + relpath[m_strlen(relpath)] = delim; } - (state->entry)[state->entrylen].desc = str_dup (relpath); + (state->entry)[state->entrylen].desc = m_strdup(relpath); (state->entry)[state->entrylen].imap = 1; /* delimiter at the root is useless. */ @@ -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,