X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fimap.c;h=db9901a114ebc56957f94a72498c1a6562871570;hp=b69c6cbcd8ab4c1da8ffdf31533116bc4e08ad4a;hb=baf1dd3593aaece5b5e213cd70558d827329b703;hpb=b25e26b05ff3172041861e032cb839871367a480 diff --git a/imap/imap.c b/imap/imap.c index b69c6cb..db9901a 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -214,7 +214,7 @@ int imap_read_literal (FILE * fp, IMAP_DATA * idata, long bytes, progress_t* bar if (bar && !(pos % 1024)) mutt_progress_bar (bar, pos); #ifdef DEBUG - if (DebugLevel >= IMAP_LOG_LTRL) + if (DebugFile && DebugLevel >= IMAP_LOG_LTRL) fputc (c, DebugFile); #endif } @@ -1136,9 +1136,12 @@ int imap_check_mailbox (CONTEXT * ctx, int *index_hint, int force) return result; } -/* returns count of recent messages if new = 1, else count of total messages. - * (useful for at least postponed function) - * Question of taste: use RECENT or UNSEEN for new? +/* + * count messages: + * new == 1: recent + * new == 2: unseen + * otherwise: total + * return: * 0+ number of messages in mailbox * -1 error while polling mailboxes */ @@ -1186,7 +1189,7 @@ int imap_mailbox_check (char *path, int new) else if (mutt_bit_isset (idata->capabilities, IMAP4REV1) || mutt_bit_isset (idata->capabilities, STATUS)) { snprintf (buf, sizeof (buf), "STATUS %s (%s)", mbox, - new ? "RECENT" : "MESSAGES"); + new == 1 ? "RECENT" : (new == 2 ? "UNSEEN" : "MESSAGES")); } else /* Server does not support STATUS, and this is not the current mailbox. @@ -1257,8 +1260,6 @@ static int do_search (const pattern_t* search, int allpats) * match types, and does a better job (eg server doesn't support regexps). */ static int imap_compile_search (const pattern_t* pat, BUFFER* buf) { - char term[STRING]; - if (! do_search (pat, 0)) return 0; @@ -1291,6 +1292,7 @@ static int imap_compile_search (const pattern_t* pat, BUFFER* buf) mutt_buffer_addch (buf, ')'); } } else { + char term[STRING]; char *delim; switch (pat->op) { @@ -1442,7 +1444,7 @@ int imap_subscribe (char *path, int subscribe) BUFFER err, token; IMAP_MBOX mx; - if (mx_get_magic (path) == M_IMAP || imap_parse_path (path, &mx)) { + if (mx_get_magic (path) != M_IMAP || imap_parse_path (path, &mx) < 0) { mutt_error (_("Bad mailbox name")); return -1; } @@ -1520,7 +1522,7 @@ static int imap_complete_hosts (char *dest, size_t len) { } } - for (conn = mutt_socket_head (); conn->next; conn = conn->next) { + for (conn = mutt_socket_head (); conn && conn->next; conn = conn->next) { ciss_url_t url; char urlstr[LONG_STRING];