summaryrefslogtreecommitdiffstats
path: root/browser.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-10-05 18:24:42 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-10-05 18:24:42 +0000
commitf9fb45338e02ec7171f58b91ba89554f3ea57098 (patch)
treedeac7277476c9626dca43c485d6458574a2b674e /browser.c
parentee4d0e3176cd0cb6778ce9fbd4ce2b7d8123fe2e (diff)
Vikas' macro_function patch.
Diffstat (limited to 'browser.c')
-rw-r--r--browser.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/browser.c b/browser.c
index 032d5d3f..62635d91 100644
--- a/browser.c
+++ b/browser.c
@@ -465,6 +465,7 @@ void mutt_select_file (char *f, size_t flen, int buffy)
MUTTMENU *menu;
struct stat st;
int i, killPrefix = 0;
+ int savedmenu = CurrentMenu;
memset (&state, 0, sizeof (struct browser_state));
@@ -515,7 +516,7 @@ void mutt_select_file (char *f, size_t flen, int buffy)
return;
menu = mutt_new_menu ();
- menu->menu = MENU_FOLDER;
+ menu->menu = CurrentMenu = MENU_FOLDER;
menu->make_entry = folder_entry;
menu->search = select_file_search;
menu->title = title;
@@ -624,6 +625,7 @@ void mutt_select_file (char *f, size_t flen, int buffy)
destroy_state (&state);
mutt_menuDestroy (&menu);
+ CurrentMenu = savedmenu;
return;
case OP_BROWSER_TELL:
@@ -662,6 +664,7 @@ void mutt_select_file (char *f, size_t flen, int buffy)
mutt_error _("Error scanning directory.");
destroy_state (&state);
mutt_menuDestroy (&menu);
+ CurrentMenu = savedmenu;
return;
}
}
@@ -718,6 +721,7 @@ void mutt_select_file (char *f, size_t flen, int buffy)
{
mutt_error _("Error scanning directory.");
mutt_menuDestroy (&menu);
+ CurrentMenu = savedmenu;
return;
}
killPrefix = 0;
@@ -736,6 +740,7 @@ void mutt_select_file (char *f, size_t flen, int buffy)
{
int reverse = 0;
+ event_t ch;
move (LINES - 1, 0);
if (i == OP_SORT_REVERSE)
@@ -747,18 +752,21 @@ void mutt_select_file (char *f, size_t flen, int buffy)
}
clrtoeol ();
- while ((i = mutt_getch ()) != EOF && i != 'a' && i != 'd' && i != 'z'
- && i != 'n')
+ FOREVER
{
- if (i == ERR || CI_is_return (i))
+ ch = mutt_getch();
+ if (ch.ch == EOF || ch.ch == 'a' || ch.ch == 'd' || ch.ch == 'z' || ch.ch == 'n')
+ break;
+
+ if (ch.ch == ERR || CI_is_return (ch.ch))
break;
else
BEEP ();
}
- if (i != EOF)
+ if (ch.ch != EOF)
{
- switch (i)
+ switch (ch.ch)
{
case 'a':
BrowserSort = reverse | SORT_SUBJECT;
@@ -805,6 +813,7 @@ void mutt_select_file (char *f, size_t flen, int buffy)
strfcpy (f, buf, flen);
destroy_state (&state);
mutt_menuDestroy (&menu);
+ CurrentMenu = savedmenu;
return;
}
MAYBE_REDRAW (menu->redraw);