/* 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);