r = 0;
#endif
fputc (c, fp);
-#ifdef USE_SOCKET
- if (bar && pos % 1024)
+ if (bar && !(pos % 1024))
mutt_progress_bar (bar, pos);
-#endif
#ifdef DEBUG
if (DebugLevel >= IMAP_LOG_LTRL)
fputc (c, DebugFile);
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
*/
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.
* 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;
mutt_buffer_addch (buf, ')');
}
} else {
+ char term[STRING];
char *delim;
switch (pat->op) {
}
}
- 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];