return 0;
}
-int select_file_search (MUTTMENU *menu, regex_t *re, int n)
+static int select_file_search (MUTTMENU *menu, regex_t *re, int n)
{
#ifdef USE_NNTP
if (option (OPTNEWS))
return (regexec (re, ((struct folder_file *) menu->data)[n].name, 0, NULL, 0));
}
-void folder_entry (char *s, size_t slen, MUTTMENU *menu, int num)
+static void folder_entry (char *s, size_t slen, MUTTMENU *menu, int num)
{
FOLDER folder;
if (option (OPTNEWS))
{
if (buffy)
- snprintf (title, titlelen, _("Subscribed newsgroups"));
+ snprintf (title, titlelen, "%s", _("Subscribed newsgroups"));
else
snprintf (title, titlelen, _("Newsgroups on server [%s]"),
CurrentNewsSrv->conn->account.host);
menu->redraw = REDRAW_FULL;
}
-int file_tag (MUTTMENU *menu, int n, int m)
+static int file_tag (MUTTMENU *menu, int n, int m)
{
struct folder_file *ff = &(((struct folder_file *)menu->data)[n]);
int ot;
else
{
getcwd (LastDir, sizeof (LastDir));
- strcat (LastDir, "/"); /* __STRCAT_CHECKED__ */
- strncat (LastDir, f, i);
+ safe_strcat (LastDir, sizeof (LastDir), "/");
+ safe_strncat (LastDir, sizeof (LastDir), f, i);
}
}
else
{
if (S_ISDIR (st.st_mode))
{
- strfcpy (LastDir, buf, sizeof (LastDir));
destroy_state (&state);
- if (examine_directory (menu, &state, LastDir, prefix) == 0)
- {
- menu->current = 0;
- menu->top = 0;
- init_menu (&state, menu, title, sizeof (title), buffy);
- }
+ if (examine_directory (menu, &state, buf, prefix) == 0)
+ strfcpy (LastDir, buf, sizeof (LastDir));
else
{
mutt_error _("Error scanning directory.");
- destroy_state (&state);
- mutt_menuDestroy (&menu);
- goto bail;
+ if (examine_directory (menu, &state, LastDir, prefix) == -1)
+ {
+ mutt_menuDestroy (&menu);
+ goto bail;
+ }
}
+ menu->current = 0;
+ menu->top = 0;
+ init_menu (&state, menu, title, sizeof (title), buffy);
}
else
mutt_error (_("%s is not a directory."), buf);