#include <lib-lib/ascii.h>
#include <lib-lib/str.h>
#include <lib-lib/buffer.h>
+#include <lib-lib/debug.h>
#include "mutt.h"
#include "mx.h"
#include "message.h"
#include "imap_private.h"
#if defined(USE_SSL) || defined(USE_GNUTLS)
-# include "mutt_ssl.h"
+# include <lib-sys/mutt_ssl.h>
#endif
#include "buffy.h"
#include <lib-lib/macros.h>
-#include "lib/debug.h"
#include <unistd.h>
#include <ctype.h>
debug_print (1, ("not a FLAGS response: %s\n", s));
return NULL;
}
- s += 5;
- SKIPWS (s);
+ s = vskipspaces(s + 5);
if (*s != '(') {
debug_print (1, ("bogus FLAGS response: %s\n", s));
return NULL;
*hflags = flags;
while (*s && *s != ')') {
- s++;
- SKIPWS (s);
+ s = vskipspaces(s + 1);
flag_word = s;
while (*s && (*s != ')') && !ISSPACE (*s))
s++;
if (mutt_bit_isset (idata->rights, ACL_WRITE))
imap_add_keywords (flags, hdr, idata->flags, sizeof (flags));
- str_skip_trailws (flags);
+ m_strrtrim(flags);
/* UW-IMAP is OK with null flags, Cyrus isn't. The only solution is to
* explicitly revoke all system flags (if we have permission) */
imap_set_flag (idata, ACL_WRITE, 1, "\\Answered ", flags, sizeof (flags));
imap_set_flag (idata, ACL_DELETE, 1, "\\Deleted ", flags, sizeof (flags));
- str_skip_trailws (flags);
+ m_strrtrim(flags);
mutt_buffer_addstr (cmd, " -FLAGS.SILENT (");
} else
p_delete(&mx.mbox);
imap_munge_mbox_name (mbox, sizeof (mbox), buf);
- strfcpy (mbox_unquoted, buf, sizeof (mbox_unquoted));
+ m_strcpy(mbox_unquoted, sizeof(mbox_unquoted), buf);
/* The draft IMAP implementor's guide warns againts using the STATUS
* command on a mailbox that you have selected
if (m_strcmp(mbox_unquoted, idata->mailbox) == 0
|| (ascii_strcasecmp (mbox_unquoted, "INBOX") == 0
&& m_strcasecmp(mbox_unquoted, idata->mailbox) == 0)) {
- strfcpy (buf, "NOOP", sizeof (buf));
+ m_strcpy(buf, sizeof(buf), "NOOP");
}
else if (mutt_bit_isset (idata->capabilities, IMAP4REV1) ||
mutt_bit_isset (idata->capabilities, STATUS)) {
mutt_buffer_addch (buf, ' ');
/* and field */
- *delim = ':';
- delim++;
- SKIPWS(delim);
+ *delim++ = ':';
+ delim = vskipspaces(delim);
imap_quote_string (term, sizeof (term), delim);
mutt_buffer_addstr (buf, term);
break;
mailbox = (BUFFY*) Incoming->data[i];
if (!m_strncmp(dest, mailbox->path, matchlen)) {
if (rc) {
- strfcpy (dest, mailbox->path, len);
+ m_strcpy(dest, len, mailbox->path);
rc = 0;
} else
longest_common_prefix (dest, mailbox->path, matchlen, len);
url_ciss_tostring (&url, urlstr, sizeof (urlstr), 0);
if (!m_strncmp(dest, urlstr, matchlen)) {
if (rc) {
- strfcpy (dest, urlstr, len);
+ m_strcpy(dest, len, urlstr);
rc = 0;
} else
longest_common_prefix (dest, urlstr, matchlen, len);
IMAP_MBOX mx;
if (imap_parse_path (path, &mx) || !mx.mbox) {
- strfcpy (dest, path, dlen);
+ m_strcpy(dest, dlen, path);
return imap_complete_hosts (dest, dlen);
}
* known mailboxes/hooks/etc */
if (!(idata = imap_conn_find (&(mx.account), M_IMAP_CONN_NONEW))) {
p_delete(&mx.mbox);
- strfcpy (dest, path, dlen);
+ m_strcpy(dest, dlen, path);
return imap_complete_hosts (dest, dlen);
}
conn = idata->conn;
imap_cmd_start (idata, buf);
/* and see what the results are */
- strfcpy (completion, NONULL (mx.mbox), sizeof (completion));
+ m_strcpy(completion, sizeof(completion), NONULL(mx.mbox));
do {
if (imap_parse_list_response (idata, &list_word, &noselect, &noinferiors,
&delim))
}
/* copy in first word */
if (!completions) {
- strfcpy (completion, list_word, sizeof (completion));
+ m_strcpy(completion, sizeof(completion), list_word);
matchlen = m_strlen(completion);
completions++;
continue;