X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=imap%2Fimap.c;h=ec31f589fd2a26242decd07d08f10db1adc215a5;hb=18da1add170065091118e7379b58d1e385faf0cd;hp=cb100cee080e34a8d93a75d0a3df21f251050bc9;hpb=238b70e39b78f585c586bd51aef41988b3cc73d1;p=apps%2Fmadmutt.git diff --git a/imap/imap.c b/imap/imap.c index cb100ce..ec31f58 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "mutt.h" #include "mx.h" @@ -28,12 +29,11 @@ #include "message.h" #include "imap_private.h" #if defined(USE_SSL) || defined(USE_GNUTLS) -# include "mutt_ssl.h" +# include #endif #include "buffy.h" #include -#include "lib/debug.h" #include #include @@ -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 @@ -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;