From bf2abf90501858a97bf1e05024d963800312a5c4 Mon Sep 17 00:00:00 2001 From: Aleksey Kuleshov Date: Thu, 18 Aug 2016 17:05:03 +0300 Subject: rework menu so that it can support multiline titles Signed-off-by: Aleksey Kuleshov Signed-off-by: Sascha Hauer --- common/boot.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'common/boot.c') diff --git a/common/boot.c b/common/boot.c index 0e9f27f9bc..bc90502284 100644 --- a/common/boot.c +++ b/common/boot.c @@ -43,7 +43,7 @@ struct bootentries *bootentries_alloc(void) if (IS_ENABLED(CONFIG_MENU)) { bootentries->menu = menu_alloc(); - bootentries->menu->display = basprintf("boot"); + menu_add_title(bootentries->menu, basprintf("boot")); } return bootentries; @@ -61,8 +61,12 @@ void bootentries_free(struct bootentries *bootentries) be->release(be); } - if (bootentries->menu) + if (bootentries->menu) { + int i; + for (i = 0; i < bootentries->menu->display_lines; i++) + free(bootentries->menu->display[i]); free(bootentries->menu->display); + } free(bootentries->menu); free(bootentries); } -- cgit v1.2.3