summaryrefslogtreecommitdiff
path: root/payloads/coreinfo
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/coreinfo')
-rw-r--r--payloads/coreinfo/coreinfo.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/payloads/coreinfo/coreinfo.c b/payloads/coreinfo/coreinfo.c
index 82a57dab19..effe94fe3a 100644
--- a/payloads/coreinfo/coreinfo.c
+++ b/payloads/coreinfo/coreinfo.c
@@ -225,6 +225,16 @@ static void print_no_modules_selected(void)
center(height / 2, "No modules selected");
}
+static int first_nonempty_category(void)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(categories); i++)
+ if (categories[i].count > 0)
+ return i;
+ return 0;
+}
+
static void loop(void)
{
int key;
@@ -233,6 +243,7 @@ static void loop(void)
print_no_modules_selected();
refresh();
+ curwin = first_nonempty_category();
print_menu();
print_submenu(&categories[curwin]);
redraw_module(&categories[curwin]);