From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] menu: Make action callback optional
Date: Wed, 19 Jun 2013 22:53:42 +0200 [thread overview]
Message-ID: <1371675222-25433-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1371675222-25433-1-git-send-email-s.hauer@pengutronix.de>
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>
---
| 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--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
--
1.8.3.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2013-06-19 20:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 20:53 Some small menu updates Sascha Hauer
2013-06-19 20:53 ` [PATCH 1/3] menu: Align entries Sascha Hauer
2013-06-19 20:53 ` [PATCH 2/3] Fix gotoXY argument order Sascha Hauer
2013-06-19 20:53 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371675222-25433-4-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox