summaryrefslogtreecommitdiffstats
path: root/common/menu.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-06-18 00:24:16 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-06-19 22:47:48 +0200
commit22350e4e6805fa41284dbaae2cf662cd8ec69765 (patch)
treebb2e95ff28a979145ebf9d6dc5b7f64fd74263ea /common/menu.c
parentf890ea69bee7a431546d146b2001aadd8e144cab (diff)
downloadbarebox-22350e4e6805fa41284dbaae2cf662cd8ec69765.tar.gz
menu: Make action callback optional
Someone calling menu_show might only be interested in the entry the user selected without having something in the action callback. Make it optional. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/menu.c')
-rw-r--r--common/menu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/menu.c b/common/menu.c
index d516db4..ef56190 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -361,7 +361,8 @@ int menu_show(struct menu *m)
break;
clear();
gotoXY(1,1);
- m->selected->action(m, m->selected);
+ if (m->selected->action)
+ m->selected->action(m, m->selected);
if (m->selected->non_re_ent)
return m->selected->num;
else