X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fmessage.c;h=ba49cd101796e98bd2413d11ab00d9de85611270;hp=1dddd5238c5fbcceb8f84edb51f99e86ea240d5b;hb=3e9a92ab72e04aecb0fc4098098a1b57c5101d84;hpb=ae0ce4dfcafa0c3820f107c5bfa8bd06e5272b57 diff --git a/imap/message.c b/imap/message.c index 1dddd52..ba49cd1 100644 --- a/imap/message.c +++ b/imap/message.c @@ -21,9 +21,11 @@ #include #include #include +#include + +#include #include "mutt.h" -#include "mutt_curses.h" #include "imap_private.h" #include "message.h" #include "mx.h" @@ -35,7 +37,6 @@ #include #include -#include "lib/debug.h" #if HAVE_STDINT_H #include @@ -247,7 +248,7 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend) fputs ("\n\n", fp); /* update context with message header */ - ctx->hdrs[msgno] = mutt_new_header (); + ctx->hdrs[msgno] = header_new(); ctx->hdrs[msgno]->index = h.sid - 1; if (h.sid != ctx->msgcount + 1) @@ -552,8 +553,7 @@ int imap_append_message (CONTEXT * ctx, MESSAGE * msg) debug_print (1, ("command failed: %s\n", idata->cmd.buf)); - pc = idata->cmd.buf + SEQLEN; - SKIPWS (pc); + pc = vskipspaces(idata->cmd.buf + SEQLEN); pc = imap_next_word (pc); mutt_error ("%s", pc); mutt_sleep (1); @@ -588,8 +588,7 @@ int imap_append_message (CONTEXT * ctx, MESSAGE * msg) char *pc; debug_print (1, ("command failed: %s\n", idata->cmd.buf)); - pc = idata->cmd.buf + SEQLEN; - SKIPWS (pc); + pc = vskipspaces(idata->cmd.buf + SEQLEN); pc = imap_next_word (pc); mutt_error ("%s", pc); mutt_sleep (1); @@ -771,8 +770,8 @@ void imap_add_keywords (char *s, HEADER * h, LIST * mailbox_flags, while (keywords) { if (msg_has_flag (mailbox_flags, keywords->data)) { - str_cat (s, slen, keywords->data); - str_cat (s, slen, " "); + m_strcat(s, slen, keywords->data); + m_strcat(s, slen, " "); } keywords = keywords->next; } @@ -970,22 +969,20 @@ static int msg_parse_fetch (IMAP_HEADER * h, char *s) return -1; while (*s) { - SKIPWS (s); + s = vskipspaces(s); if (ascii_strncasecmp ("FLAGS", s, 5) == 0) { if ((s = msg_parse_flags (h, s)) == NULL) return -1; } else if (ascii_strncasecmp ("UID", s, 3) == 0) { - s += 3; - SKIPWS (s); + s = vskipspaces(s + 3); h->data->uid = (unsigned int) atoi (s); s = imap_next_word (s); } else if (ascii_strncasecmp ("INTERNALDATE", s, 12) == 0) { - s += 12; - SKIPWS (s); + s = vskipspaces(s + 12); if (*s != '\"') { debug_print (1, ("bogus INTERNALDATE entry: %s\n", s)); return -1; @@ -1001,8 +998,7 @@ static int msg_parse_fetch (IMAP_HEADER * h, char *s) h->received = imap_parse_date (tmp); } else if (ascii_strncasecmp ("RFC822.SIZE", s, 11) == 0) { - s += 11; - SKIPWS (s); + s = vskipspaces(s + 11); ptmp = tmp; while (isdigit ((unsigned char) *s)) *ptmp++ = *s++; @@ -1036,8 +1032,7 @@ static char *msg_parse_flags (IMAP_HEADER * h, 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; @@ -1081,7 +1076,7 @@ static char *msg_parse_flags (IMAP_HEADER * h, char *s) mutt_add_list (h->data->keywords, flag_word); *s = ctmp; } - SKIPWS (s); + s = vskipspaces(s); } /* wrap up, or note bad flags response */