diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-06-18 00:24:16 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-06-19 22:47:48 +0200 |
commit | 22350e4e6805fa41284dbaae2cf662cd8ec69765 (patch) | |
tree | bb2e95ff28a979145ebf9d6dc5b7f64fd74263ea | |
parent | f890ea69bee7a431546d146b2001aadd8e144cab (diff) | |
download | barebox-22350e4e6805fa41284dbaae2cf662cd8ec69765.tar.gz barebox-22350e4e6805fa41284dbaae2cf662cd8ec69765.tar.xz |
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>
-rw-r--r-- | common/menu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/menu.c b/common/menu.c index d516db4900..ef56190604 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 |