From: Pietro Cerutti Date: Sun, 5 Feb 2017 15:59:17 +0000 (+0000) Subject: Avoid browsing the remote spoolfile by setting MUTT_SELECT_MULTI attach X-Git-Tag: neomutt-20170225~22^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F400%2Fhead;p=neomutt Avoid browsing the remote spoolfile by setting MUTT_SELECT_MULTI attach Closes #336 --- diff --git a/browser.c b/browser.c index 1eb232408..8483b119d 100644 --- a/browser.c +++ b/browser.c @@ -79,7 +79,6 @@ typedef struct folder_t static char OldLastDir[_POSIX_PATH_MAX] = ""; static char LastDir[_POSIX_PATH_MAX] = ""; -static char LastDirBackup[_POSIX_PATH_MAX] = ""; /* Frees up the memory allocated for the local-global variables. */ static void destroy_state (struct browser_state *state) @@ -1050,9 +1049,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num memset (&state, 0, sizeof (struct browser_state)); - if (!folder) - strfcpy (LastDirBackup, LastDir, sizeof (LastDirBackup)); - #ifdef USE_NNTP if (option (OPTNEWS)) { @@ -1133,9 +1129,9 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num else #endif { - if (!folder) + if (!*LastDir) getcwd (LastDir, sizeof (LastDir)); - else + if (folder) { /* Whether we use the tracking feature of the browser depends * on which sort method we chose to use. This variable is defined @@ -2088,8 +2084,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num bail: - if (!folder) - strfcpy (LastDir, LastDirBackup, sizeof (LastDir)); if (GotoSwapper[0]) GotoSwapper[0] = '\0'; } diff --git a/compose.c b/compose.c index 83eb6a479..3445f11d6 100644 --- a/compose.c +++ b/compose.c @@ -823,7 +823,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ files = NULL; if (_mutt_enter_fname (prompt, fname, sizeof (fname), - &menu->redraw, 0, 1, &files, &numfiles, 0) == -1 || + &menu->redraw, 0, 1, &files, &numfiles, MUTT_SEL_MULTI) == -1 || *fname == '\0') break;