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-23 19:51:06 +0800 |
commit | 9851c9cc87a3e2d866743bd413858550c77d7836 (patch) | |
tree | 41bf52ac14c0bf82c801e0dd0a7cd72815e1d43c /common/menu.c | |
parent | d18fef5a63e3ad203b96f4bec8cdbb81308c23e2 (diff) | |
download | barebox-9851c9cc87a3e2d866743bd413858550c77d7836.tar.gz barebox-9851c9cc87a3e2d866743bd413858550c77d7836.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/menu.c')
-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 83821ec285..6c530b6f86 100644 --- a/common/menu.c +++ b/common/menu.c @@ -296,7 +296,7 @@ static int menu_alloc_display_buffer(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; @@ -388,7 +388,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); @@ -399,6 +404,7 @@ int menu_show(struct menu *m) default: break; } + ch_previous = ch; } while(1); return 0; |