Diff between 5e7ad41d088fb5d169256df61bc93ce33bc0fbef and a6ef232a3500e4dd8ceae01ded8a3eb27c34f9b3

Changed Files

File Additions Deletions Status
src/shared/shell.c +5 -2 modified

Full Patch

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 0878cad..d262f53 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -195,8 +195,11 @@ static void shell_print_menu(void)
 	}
 
 	for (entry = default_menu; entry->cmd; entry++) {
-		/* Skip menu command if not on main menu */
-		if (data.menu != data.main && !strcmp(entry->cmd, "menu"))
+		/* Skip menu command if not on main menu or if there are no
+		 * submenus.
+		 */
+		if ((data.menu != data.main && !strcmp(entry->cmd, "menu")) ||
+					queue_isempty(data.submenus))
 			continue;
 
 		/* Skip back command if on main menu */