summaryrefslogtreecommitdiffstats
path: root/browser.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-10-07 15:16:41 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-10-07 15:16:41 +0000
commit13b800b58cd2d839a3ad96350cde72ddba7675d8 (patch)
tree1a7153768997b3c2284dc3fa48d7074d5d9ee1ff /browser.c
parent40e1fab1466cd2db0ca8f376a1be70c180297037 (diff)
Clean up behind an aborted sort-by prompt on the file browser. From
Vikas.
Diffstat (limited to 'browser.c')
-rw-r--r--browser.c47
1 files changed, 26 insertions, 21 deletions
diff --git a/browser.c b/browser.c
index 62635d91..6b84a7c4 100644
--- a/browser.c
+++ b/browser.c
@@ -739,7 +739,7 @@ void mutt_select_file (char *f, size_t flen, int buffy)
case OP_SORT_REVERSE:
{
- int reverse = 0;
+ int reverse = 0, done = 0;
event_t ch;
move (LINES - 1, 0);
@@ -755,35 +755,40 @@ void mutt_select_file (char *f, size_t flen, int buffy)
FOREVER
{
ch = mutt_getch();
- if (ch.ch == EOF || ch.ch == 'a' || ch.ch == 'd' || ch.ch == 'z' || ch.ch == 'n')
+ if (ch.ch == 'a' || ch.ch == 'd' || ch.ch == 'z' || ch.ch == 'n')
break;
- if (ch.ch == ERR || CI_is_return (ch.ch))
+ if (ch.ch == -1 || CI_is_return (ch.ch))
+ {
+ done = 1;
+ CLEARLINE (LINES - 1);
break;
+ }
else
BEEP ();
}
- if (ch.ch != EOF)
+ /* nothing to be done */
+ if (done)
+ break;
+
+ switch (ch.ch)
{
- switch (ch.ch)
- {
- case 'a':
- BrowserSort = reverse | SORT_SUBJECT;
- break;
- case 'd':
- BrowserSort = reverse | SORT_DATE;
- break;
- case 'z':
- BrowserSort = reverse | SORT_SIZE;
- break;
- case 'n':
- BrowserSort = SORT_ORDER;
- break;
- }
- browser_sort (&state);
- menu->redraw = REDRAW_FULL;
+ case 'a':
+ BrowserSort = reverse | SORT_SUBJECT;
+ break;
+ case 'd':
+ BrowserSort = reverse | SORT_DATE;
+ break;
+ case 'z':
+ BrowserSort = reverse | SORT_SIZE;
+ break;
+ case 'n':
+ BrowserSort = SORT_ORDER;
+ break;
}
+ browser_sort (&state);
+ menu->redraw = REDRAW_FULL;
}
break;