X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=browser.c;h=12c41a9ee5ecf662eb0a32d3207b67c0aee03414;hp=443283d47286bb5be8149e8eec6e225dedfbbd5e;hb=d36bae62c0892340fc8636158df066039f257a8f;hpb=b8c71f93b0296f815a6538182343ba67e88c0012 diff --git a/browser.c b/browser.c index 443283d..12c41a9 100644 --- a/browser.c +++ b/browser.c @@ -11,17 +11,28 @@ # include "config.h" #endif +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include #include #include +#include +#include +#include + #include "mutt.h" -#include "enter.h" #include "mx.h" -#include "mutt_curses.h" -#include "mutt_menu.h" #include "buffy.h" #include "sort.h" #include "browser.h" @@ -36,14 +47,6 @@ #include "lib/list.h" -#include -#include -#include -#include -#include -#include -#include - static struct mapping_t FolderHelp[] = { {N_("Exit"), OP_EXIT}, {N_("Chdir"), OP_CHANGE_DIRECTORY}, @@ -76,7 +79,7 @@ static char LastDirBackup[_POSIX_PATH_MAX] = ""; /* Frees up the memory allocated for the local-global variables. */ static void destroy_state (struct browser_state *state) { - unsigned int c; + int c; for (c = 0; c < state->entrylen; c++) { p_delete(&((state->entry)[c].name)); @@ -159,7 +162,7 @@ static int link_is_dir (const char *folder, const char *path) return 0; } -static const char *folder_format_str (char *dest, size_t destlen, char op, +static const char *folder_format_str (char *dest, ssize_t destlen, char op, const char *src, const char *fmt, const char *ifstring, const char *elsestring, @@ -323,7 +326,7 @@ static const char *folder_format_str (char *dest, size_t destlen, char op, } #ifdef USE_NNTP -static const char *newsgroup_format_str (char *dest, size_t destlen, char op, +static const char *newsgroup_format_str (char *dest, ssize_t destlen, char op, const char *src, const char *fmt, const char *ifstring, const char *elsestring, @@ -465,7 +468,7 @@ static int examine_directory (MUTTMENU * menu, struct browser_state *state, { #ifdef USE_NNTP if (option (OPTNEWS)) { - LIST *tmp; + string_list_t *tmp; NNTP_DATA *data; NNTP_SERVER *news = CurrentNewsSrv; @@ -566,7 +569,7 @@ static int examine_mailboxes (MUTTMENU * menu, struct browser_state *state) #ifdef USE_NNTP if (option (OPTNEWS)) { - LIST *tmp; + string_list_t *tmp; NNTP_DATA *data; NNTP_SERVER *news = CurrentNewsSrv; @@ -652,7 +655,7 @@ static int select_file_search (MUTTMENU * menu, regex_t * re, int n) (re, ((struct folder_file *) menu->data)[n].name, 0, NULL, 0)); } -static void folder_entry (char *s, size_t slen, MUTTMENU * menu, int num) +static void folder_entry (char *s, ssize_t slen, MUTTMENU * menu, int num) { FOLDER folder; @@ -670,7 +673,7 @@ static void folder_entry (char *s, size_t slen, MUTTMENU * menu, int num) } static void init_menu (struct browser_state *state, MUTTMENU * menu, - char *title, size_t titlelen, int buffy) + char *title, ssize_t titlelen, int buffy) { char path[_POSIX_PATH_MAX]; @@ -728,7 +731,7 @@ static int file_tag (MUTTMENU * menu, int n, int m) return ff->tagged - ot; } -void _mutt_select_file (char *f, size_t flen, int flags, char ***files, +void _mutt_select_file (char *f, ssize_t flen, int flags, char ***files, int *numfiles) { char buf[_POSIX_PATH_MAX]; @@ -755,7 +758,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, if (*f) m_strcpy(prefix, sizeof(prefix), f); else { - LIST *list; + string_list_t *list; /* default state for news reader mode is browse subscribed newsgroups */ buffy = 0; @@ -917,7 +920,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, url_parse_ciss (&url, state.entry[menu->current].name); if (url.path && (state.entry[menu->current].delim != '\0') && - (n < sizeof (LastDir))) { + (n < ssizeof (LastDir))) { LastDir[n] = '\0'; LastDir[n - 1] = state.entry[menu->current].delim; } @@ -980,7 +983,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, if (multiple) { char **tfiles; int j; - unsigned int h; + int h; if (menu->tagged) { *numfiles = menu->tagged; @@ -1111,9 +1114,9 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, if (!state.imap_browse) { /* add '/' at the end of the directory name if not already there */ - size_t len = m_strlen(LastDir); + ssize_t len = m_strlen(LastDir); - if (len && LastDir[len - 1] != '/' && sizeof (buf) > len) + if (len && LastDir[len - 1] != '/' && ssizeof(buf) > len) buf[len] = '/'; } @@ -1383,7 +1386,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, break; { - LIST *tmp; + string_list_t *tmp; NNTP_DATA *data; for (tmp = CurrentNewsSrv->list; tmp; tmp = tmp->next) { @@ -1477,7 +1480,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, } } if (i == OP_SUBSCRIBE_PATTERN) { - LIST *grouplist = NULL; + string_list_t *grouplist = NULL; if (news) grouplist = news->list;