Make the hidden timeout behaviour match the rest of the menu
authorH. Peter Anvin <hpa@zytor.com>
Wed, 25 Jul 2007 00:15:07 +0000 (17:15 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 25 Jul 2007 00:15:07 +0000 (17:15 -0700)
com32/modules/menumain.c

index 4282646..73082f7 100644 (file)
@@ -793,6 +793,9 @@ run_menu(void)
   const char *cmdline = NULL;
   volatile clock_t key_timeout, timeout_left, this_timeout;
 
+  /* Note: for both key_timeout and timeout == 0 means no limit */
+  timeout_left = key_timeout = timeout;
+
   /* If we're in shiftkey mode, exit immediately unless a shift key is pressed */
   if ( shiftkey && !shift_is_held() ) {
     return menu_entries[defentry].cmdline;
@@ -807,12 +810,9 @@ run_menu(void)
     /* Otherwise display the menu now; the timeout has already been
        cancelled, since the user pressed a key. */
     hiddenmenu = 0;
-    timeout = 0;
+    key_timeout = 0;
   }
 
-  /* Note: for both key_timeout and timeout == 0 means no limit */
-  timeout_left = key_timeout = timeout;
-
   /* Handle both local and global timeout */
   if ( setjmp(timeout_jump) ) {
     entry = defentry;