diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-04-23 19:12:31 +0800 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-04-25 18:37:41 +0800 |
commit | eb7667b68167897832de9e8ac0039cc8f6de7b7d (patch) | |
tree | 1a8f91efb14401a7a8ed724ca7128b97132887ce /common | |
parent | 76c9becdc2c623c7a5b4f14b60ff7442e2836621 (diff) | |
download | barebox-eb7667b68167897832de9e8ac0039cc8f6de7b7d.tar.gz barebox-eb7667b68167897832de9e8ac0039cc8f6de7b7d.tar.xz |
menu: fix support for "\n", "\n\r" and "\r"
If "\n\r" or "\r\n" is ignore one.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/menu.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/common/menu.c b/common/menu.c index e85a3200ea..191bd64cd2 100644 --- a/common/menu.c +++ b/common/menu.c @@ -252,7 +252,7 @@ static void print_menu(struct menu *m) int menu_show(struct menu *m) { - int ch; + int ch, ch_previous = 0; int escape = 0; int countdown; int auto_display_len = 16; @@ -339,7 +339,12 @@ int menu_show(struct menu *m) m->selected->action(m, m->selected); print_menu_entry(m, m->selected, 1); break; + case KEY_ENTER: + if (ch_previous == KEY_RETURN) + break; case KEY_RETURN: + if (ch_previous == KEY_ENTER) + break; clear(); gotoXY(1,1); m->selected->action(m, m->selected); @@ -350,6 +355,7 @@ int menu_show(struct menu *m) default: break; } + ch_previous = ch; } while(1); return 0; |