From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpPOY-0005an-1Z for barebox@lists.infradead.org; Wed, 19 Jun 2013 20:54:22 +0000 From: Sascha Hauer Date: Wed, 19 Jun 2013 22:53:42 +0200 Message-Id: <1371675222-25433-4-git-send-email-s.hauer@pengutronix.de> In-Reply-To: <1371675222-25433-1-git-send-email-s.hauer@pengutronix.de> References: <1371675222-25433-1-git-send-email-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 3/3] menu: Make action callback optional To: barebox@lists.infradead.org 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 --- common/menu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 1.8.3.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox