Patchwork [U-Boot,v2] common, menu: do not timeout again if an item was selected but not found

login
register
mail settings
Submitter Heiko Schocher
Date Jan. 18, 2012, 6:18 a.m.
Message ID <1326867491-20038-1-git-send-email-hs@denx.de>
Download mbox | patch
Permalink /patch/136556/
State New
Delegated to: Mike Frysinger
Headers show

Comments

Heiko Schocher - Jan. 18, 2012, 6:18 a.m.
Signed-off-by: Heiko Schocher <hs@denx.de>
Acked-by: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Mike Frysinger <vapier@gentoo.org>

---
- changes for v2:
  - add Acked-by from Jason Hobbs <jason.hobbs@calxeda.com>
  - add comment from Mike Frysinger:
    - respell summary text
---
 common/menu.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Patch

diff --git a/common/menu.c b/common/menu.c
index 754a9f9..aa16c9a 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -236,8 +236,10 @@  static inline int menu_interactive_choice(struct menu *m, void **choice)
 		if (readret >= 0) {
 			choice_item = menu_item_by_key(m, cbuf);
 
-			if (!choice_item)
+			if (!choice_item) {
 				printf("%s not found\n", cbuf);
+				m->timeout = 0;
+			}
 		} else {
 			puts("^C\n");
 			return -EINTR;