#endif
#include <lib-lib/mem.h>
+#include <lib-lib/ascii.h>
+#include <lib-lib/str.h>
#include "mutt.h"
-#include "ascii.h"
#include "buffer.h"
#include "mx.h"
#include "globals.h"
#endif
#include "buffy.h"
-#include "lib/intl.h"
-#include "lib/str.h"
+#include <lib-lib/macros.h>
#include "lib/debug.h"
#include <unistd.h>
/* Clean up path and replace the one in the ctx */
imap_fix_path (idata, mx.mbox, buf, sizeof (buf));
p_delete(&(idata->mailbox));
- idata->mailbox = str_dup (buf);
+ idata->mailbox = m_strdup(buf);
imap_qualify_path (buf, sizeof (buf), &mx, idata->mailbox);
p_delete(&(ctx->path));
- ctx->path = str_dup (buf);
+ ctx->path = m_strdup(buf);
idata->ctx = ctx;
if ((rc = imap_check_mailbox (ctx, index_hint, 0)) != 0)
return rc;
- memset (&cmd, 0, sizeof (cmd));
+ p_clear(&cmd, 1);
/* if we are expunging anyway, we can do deleted messages very quickly... */
if (expunge && mutt_bit_isset (idata->rights, ACL_DELETE)) {
/* The mailbox name may or may not be quoted here. We could try to
* munge the server response and compare with quoted (or vise versa)
* but it is probably more efficient to just strncmp against both. */
- if (str_ncmp (mbox_unquoted, s, str_len (mbox_unquoted)) == 0
- || str_ncmp (mbox, s, str_len (mbox)) == 0) {
+ if (str_ncmp (mbox_unquoted, s, m_strlen(mbox_unquoted)) == 0
+ || str_ncmp (mbox, s, m_strlen(mbox)) == 0) {
s = imap_next_word (s);
s = imap_next_word (s);
if (isdigit ((unsigned char) *s)) {
if (!do_search (pat, 1))
return 0;
- memset (&buf, 0, sizeof (buf));
+ p_clear(&buf, 1);
mutt_buffer_addstr (&buf, "UID SEARCH ");
if (imap_compile_search (pat, &buf) < 0) {
p_delete(&buf.data);
imap_fix_path (idata, mx.mbox, buf, sizeof (buf));
if (option (OPTIMAPCHECKSUBSCRIBED)) {
- memset (&token, 0, sizeof (token));
+ p_clear(&token, 1);
err.data = errstr;
err.dsize = sizeof (errstr);
snprintf (mbox, sizeof (mbox), "%smailboxes \"%s\"",
int matchlen;
int i = 0;
- matchlen = str_len (dest);
+ matchlen = m_strlen(dest);
if (list_empty (Incoming))
return (-1);
for (i = 0; i < Incoming->length; i++) {
/* if the folder isn't selectable, append delimiter to force browse
* to enter it on second tab. */
if (noselect) {
- clen = str_len (list_word);
+ clen = m_strlen(list_word);
list_word[clen++] = delim;
list_word[clen] = '\0';
}
/* copy in first word */
if (!completions) {
strfcpy (completion, list_word, sizeof (completion));
- matchlen = str_len (completion);
+ matchlen = m_strlen(completion);
completions++;
continue;
}