int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * a2)
{
const char* user = NONULL (Username);
+#ifdef USE_IMAP
const char* login = NONULL (Username);
+#endif
if (a1->type != a2->type)
return 0;
ascii_strncasecmp (type, t->data, i) == 0) ||
ascii_strcasecmp (type, t->data) == 0) {
- BODY tmp = { 0 };
+ BODY tmp;
int n;
if ((n = mutt_lookup_mime_type (&tmp, b->filename)) != TYPEOTHER) {
/* Frees up the memory allocated for the local-global variables. */
static void destroy_state (struct browser_state *state)
{
- int c;
+ unsigned int c;
for (c = 0; c < state->entrylen; c++) {
p_delete(&((state->entry)[c].name));
}
#endif /* USE_NNTP */
+#ifdef USE_NNTP
static void add_folder (MUTTMENU * m, struct browser_state *state,
const char *name, const struct stat *s,
void *data, int new)
+#else
+static void add_folder (MUTTMENU * m, struct browser_state *state,
+ const char *name, const struct stat *s,
+ int new)
+#endif
{
if (state->entrylen == state->entrymax) {
/* need to allocate more space */
continue;
if (!((regexec (Mask.rx, data->group, 0, NULL, 0) == 0) ^ Mask.not))
continue;
+#ifdef USE_NNTP
add_folder (menu, state, data->group, NULL, data, data->new);
+#else
+ add_folder (menu, state, data->group, NULL, data->new);
+#endif
}
sidebar_draw (CurrentMenu);
}
continue;
i = buffy_lookup (buffer);
+#ifdef USE_NNTP
add_folder (menu, state, de->d_name, &s, NULL, i >= 0 ? ((BUFFY*) Incoming->data[i])->new : 0);
+#else
+ add_folder (menu, state, de->d_name, &s, i >= 0 ? ((BUFFY*) Incoming->data[i])->new : 0);
+#endif
}
closedir (dp);
}
else
#endif
{
- int i = 0;
+ unsigned int i = 0;
BUFFY* tmp;
if (!Incoming)
tmp->magic = mx_get_magic (tmp->path);
#ifdef USE_IMAP
if (tmp->magic == M_IMAP) {
+#ifdef USE_NNTP
add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
+#else
+ add_folder (menu, state, tmp->path, NULL, tmp->new);
+#endif
continue;
}
#endif
#ifdef USE_POP
if (tmp->magic == M_POP) {
+#ifdef USE_NNTP
add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
+#else
+ add_folder (menu, state, tmp->path, NULL, tmp->new);
+#endif
continue;
}
#endif
m_strcpy(buffer, sizeof(buffer), NONULL(tmp->path));
mutt_pretty_mailbox (buffer);
+#ifdef USE_NNTP
add_folder (menu, state, buffer, &s, NULL, tmp->new);
+#else
+ add_folder (menu, state, buffer, &s, tmp->new);
+#endif
}
}
browser_sort (state);
for (i = m_strlen(f) - 1; i > 0 && f[i] != '/'; i--);
if (i > 0) {
if (f[0] == '/') {
- i = MIN(sizeof(LastDir) - 1, i);
+ i = MIN(ssizeof(LastDir) - 1, i);
m_strcpy(LastDir, sizeof(LastDir), f);
}
else {
if (multiple) {
char **tfiles;
- int i, j;
+ int j;
+ unsigned int h;
if (menu->tagged) {
*numfiles = menu->tagged;
tfiles = p_new(char *, *numfiles);
- for (i = 0, j = 0; i < state.entrylen; i++) {
+ for (h = 0, j = 0; h < state.entrylen; i++) {
struct folder_file ff = state.entry[i];
char full[_POSIX_PATH_MAX];
#endif
{
/* add '/' at the end of the directory name if not already there */
- int len = m_strlen(LastDir);
+ size_t len = m_strlen(LastDir);
if (len && LastDir[len - 1] != '/' && sizeof (buf) > len)
buf[len] = '/';
}
else {
BODY *b;
- char buf[_POSIX_PATH_MAX];
+ char nbuf[_POSIX_PATH_MAX];
- mutt_concat_path(buf, sizeof(buf), LastDir,
+ mutt_concat_path(nbuf, sizeof(nbuf), LastDir,
state.entry[menu->current].name);
- b = mutt_make_file_attach (buf);
+ b = mutt_make_file_attach (nbuf);
if (b != NULL) {
mutt_view_attachment (NULL, b, M_REGULAR, NULL, NULL, 0);
mutt_free_body (&b);
}
int buffy_lookup (const char* path) {
- int i = 0;
+ unsigned int i = 0;
if (list_empty(Incoming) || !path || !*path)
return (-1);
for (i = 0; i < Incoming->length; i++) {
}
int buffy_parse_mailboxes (BUFFER * path, BUFFER * s, unsigned long data,
- BUFFER * err)
+ BUFFER * err __attribute__ ((unused)))
{
BUFFY* tmp;
char buf[_POSIX_PATH_MAX];
struct stat contex_sb;
time_t now, last1;
CONTEXT *ctx;
- int i = 0, local = 0, count = 0;
+ unsigned int i = 0;
+ int local = 0, count = 0;
#ifdef USE_IMAP
time_t last2;
BuffyCount++;
if (count) {
DIR *dp;
- struct dirent *de;
if ((dp = opendir (path)) == NULL)
break;
int pos;
int first;
int have_unnotified = BuffyNotify;
- int i = 0;
+ unsigned int i = 0;
pos = 0;
first = 1;
*/
void buffy_next (char *s, size_t slen)
{
- int i = 0, c = 0, l = 0;
+ unsigned int l = 0;
+ int c = 0, i = 0;
if (list_empty(Incoming))
return;
outrepl = "?";
my_iconv(cd, 0, 0, &ob, &obl);
if (obl) {
- int n = m_strlen(outrepl);
+ size_t n = m_strlen(outrepl);
if (n > obl) {
outrepl = "?";
fc->inrepls = mutt_is_utf8 (to) ? repls : repls + 1;
}
else
- fc = p_new(struct fgetconv_not, 1);
+ fc = p_new(struct fgetconv_s, 1);
fc->file = file;
fc->cd = cd;
return (FGETCONV *) fc;
{
iconv_t cd;
char *buf, *ob;
- size_t obl, n;
+ size_t obl;
+ ssize_t n;
int e;
cd = mutt_iconv_open (to, from, 0);
obl = 4 * flen + 1;
ob = buf = xmalloc(obl);
n = my_iconv(cd, &f, &flen, &ob, &obl);
- if (n == (size_t) (-1) || my_iconv(cd, 0, 0, &ob, &obl) == (size_t) (-1)) {
+ if (n < 0 || my_iconv(cd, 0, 0, &ob, &obl) < 0) {
e = errno;
p_delete(&buf);
iconv_close (cd);
}
static int
-_mutt_parse_uncolor (BUFFER * buf, BUFFER * s, unsigned long data,
+_mutt_parse_uncolor (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ ((unused)),
BUFFER * err, short parse_uncolor)
{
int object = 0, do_cache = 0;
#ifdef HAVE_COLOR
-int mutt_parse_color (BUFFER * buff, BUFFER * s, unsigned long data,
+int mutt_parse_color (BUFFER * buff, BUFFER * s, unsigned long data __attribute__ ((unused)),
BUFFER * err)
{
int dry_run = 0;
#endif
-int mutt_parse_mono (BUFFER * buff, BUFFER * s, unsigned long data,
+int mutt_parse_mono (BUFFER * buff, BUFFER * s, unsigned long data __attribute__ ((unused)),
BUFFER * err)
{
int dry_run = 0;
};
#endif
-static void snd_entry (char *b, size_t blen, MUTTMENU * menu, int num) {
+
+static void snd_entry (char *b, ssize_t blen, MUTTMENU * menu, int num) {
int w=(COLS-SW)>blen?blen:COLS-SW;
mutt_FormatString (b, w, NONULL (AttachFormat), mutt_attach_fmt,
(unsigned long) (((ATTACHPTR **) menu->data)[num]),
return (src);
}
-static void compose_status_line (char *buf, size_t buflen, MUTTMENU * menu,
+static void compose_status_line (char *buf, ssize_t buflen, MUTTMENU * menu,
const char *p)
{
int w=(COLS-SW)>buflen?buflen:(COLS-SW);
ATTACHPTR **idx = NULL;
short idxlen = 0;
short idxmax = 0;
- int i, close = 0;
+ int i, closed = 0;
int r = -1; /* return value */
int op = 0;
int loop = 1;
(op == OP_COMPOSE_EDIT_HEADERS ||
(op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) {
const char *tag = NULL;
- char *err = NULL;
+ const char *err = NULL;
mutt_env_to_local (msg->env);
mutt_edit_headers (NONULL (Editor), msg->content->filename, msg,
set_option (OPTATTACHMSG);
mutt_message _("Tag the messages you want to attach!");
- close = mutt_index_menu ();
+ closed = mutt_index_menu ();
unset_option (OPTATTACHMSG);
if (!Context) {
}
menu->redraw |= REDRAW_FULL;
- if (close == OP_QUIT)
+ if (closed == OP_QUIT)
mx_close_mailbox (Context, NULL);
else
mx_fastclose_mailbox (Context);
-static void compose_status_line(char *buf, size_t buflen, MUTTMENU * menu,const char *p);
+static void compose_status_line(char *buf, ssize_t buflen, MUTTMENU * menu,const char *p);
}
if (flags & CH_UPDATE_LEN && (flags & CH_NOLEN) == 0) {
- fprintf (out, "Content-Length: %zd\n", h->content->length);
+ fprintf (out, "Content-Length: %lld\n", h->content->length);
if (h->lines != 0 || h->content->length == 0)
fprintf (out, "Lines: %d\n", h->lines);
}
if (mutt_copy_header (fpin, hdr, fpout,
chflags | CH_NOLEN | CH_NONEWLINE, NULL))
return -1;
- fprintf (fpout, "Content-Length: %zd\n", new_length);
+ fprintf (fpout, "Content-Length: %lld\n", new_length);
if (new_lines <= 0)
new_lines = 0;
else
*/
int
-_mutt_append_message (CONTEXT * dest, FILE * fpin, CONTEXT * src,
+_mutt_append_message (CONTEXT * dest, FILE * fpin, CONTEXT * src __attribute__ ((unused)),
HEADER * hdr, BODY * body, int flags, int chflags) {
char buf[STRING];
MESSAGE *msg;
if (part->deleted) {
fprintf (fpout,
"Content-Type: message/external-body; access-type=x-mutt-deleted;\n"
- "\texpiration=%s; length=%zd\n"
+ "\texpiration=%s; length=%lld\n"
"\n", date + 5, part->length);
if (ferror (fpout))
return -1;
char *keys; /* keys used in the prompt */
/* callback to generate an index line for the requested element */
- void (*make_entry) (char *, size_t, struct menu_t *, int);
+ void (*make_entry) (char *, ssize_t, struct menu_t *, int);
/* how to search the menu */
int (*search) (struct menu_t *, regex_t * re, int n);