In some cases, such as tag-prefix or _mutt_enter_string(), it is
desirable to be able to distinguish between a timeout/sigwinch event
and an input error/abort/ctrl-g.
do_buffy_notify = 1;
}
- if (op != -1)
+ if (op >= 0)
mutt_curs_set(0);
if (menu->menu == MENU_MAIN)
mutt_debug(4, "mutt_index_menu[%d]: Got op %d\n", __LINE__, op);
- if (op == -1)
+ if (op < 0)
{
mutt_timeout_hook();
continue; /* either user abort or timeout */
* set CurrentMenu incorrectly when we return back to the index menu. */
menu->menu = MENU_MAIN;
- if ((op = mutt_display_message(CURHDR)) == -1)
+ if ((op = mutt_display_message(CURHDR)) < 0)
{
unset_option(OPTNEEDRESORT);
break;
}
mutt_refresh();
- if ((ch = km_dokey(MENU_EDITOR)) == -1)
+ if ((ch = km_dokey(MENU_EDITOR)) < 0)
{
- rv = SigWinch ? 1 : -1;
+ rv = (SigWinch && ch == -2) ? 1 : -1;
goto bye;
}
* >0 function to execute
* OP_NULL no function bound to key sequence
* -1 error occurred while reading input
+ * -2 a timeout or sigwinch occurred
*/
int km_dokey(int menu)
{
LastKey = tmp.ch;
if (LastKey < 0)
- return -1;
+ return LastKey;
/* do we have an op already? */
if (tmp.op)
}
#endif
- if (i == -1)
+ if (i < 0)
continue;
if (!menu->dialog)
OldHdr = NULL;
ch = km_dokey(MENU_PAGER);
- if (ch != -1)
+ if (ch >= 0)
{
mutt_clear_error();
}
continue;
}
#endif
- if (ch == -1)
+ if (ch < 0)
{
ch = 0;
mutt_timeout_hook();