X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fimap.c;h=57648c6b55fa0c9c401fbb43ace4571df15835a8;hp=44d3eeed9b82c18976259b6885286a2ee466841c;hb=93b012884de4ca5e1f2550f767d0b8680b9c0e9f;hpb=c98480f8568e6c1bc927c6c5f2b5e80b4aa6548c diff --git a/imap/imap.c b/imap/imap.c index 44d3eee..57648c6 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -493,8 +493,7 @@ static char *imap_get_flags (LIST ** hflags, char *s) 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; @@ -505,8 +504,7 @@ static char *imap_get_flags (LIST ** hflags, char *s) *hflags = flags; while (*s && *s != ')') { - s++; - SKIPWS (s); + s = vskipspaces(s + 1); flag_word = s; while (*s && (*s != ')') && !ISSPACE (*s)) s++; @@ -906,7 +904,7 @@ int imap_sync_message (IMAP_DATA *idata, HEADER *hdr, BUFFER *cmd, 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) */ @@ -917,7 +915,7 @@ int imap_sync_message (IMAP_DATA *idata, HEADER *hdr, BUFFER *cmd, 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 @@ -1176,7 +1174,7 @@ int imap_mailbox_check (char *path, int new) 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 @@ -1185,7 +1183,7 @@ int imap_mailbox_check (char *path, int new) 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)) { @@ -1311,9 +1309,8 @@ static int imap_compile_search (const pattern_t* pat, BUFFER* buf) 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; @@ -1516,7 +1513,7 @@ static int imap_complete_hosts (char *dest, size_t len) { 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); @@ -1537,7 +1534,7 @@ static int imap_complete_hosts (char *dest, size_t 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); @@ -1563,7 +1560,7 @@ int imap_complete (char *dest, size_t dlen, char *path) { 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); } @@ -1571,7 +1568,7 @@ int imap_complete (char *dest, size_t dlen, char *path) { * 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; @@ -1590,7 +1587,7 @@ int imap_complete (char *dest, size_t dlen, char *path) { 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)) @@ -1609,7 +1606,7 @@ int imap_complete (char *dest, size_t dlen, char *path) { } /* 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;