From 581f87750d579ec06ce4ea823f92a6a3d6f093b6 Mon Sep 17 00:00:00 2001 From: ru Date: Wed, 29 Sep 2004 13:43:55 +0000 Subject: Fixed exiting from pager using the `q' key while paging "help index" or "help " with list of subtopics. --- sys/boot/common/commands.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys') diff --git a/sys/boot/common/commands.c b/sys/boot/common/commands.c index 38aa0a3..5eb599c 100644 --- a/sys/boot/common/commands.c +++ b/sys/boot/common/commands.c @@ -100,7 +100,7 @@ help_getnext(int fd, char **topic, char **subtopic, char **desc) } } -static void +static int help_emitsummary(char *topic, char *subtopic, char *desc) { int i; @@ -119,7 +119,7 @@ help_emitsummary(char *topic, char *subtopic, char *desc) } while (i++ < 30); pager_output(desc); } - pager_output("\n"); + return (pager_output("\n")); } @@ -162,7 +162,8 @@ command_help(int argc, char *argv[]) while(help_getnext(hfd, &t, &s, &d)) { if (doindex) { /* dink around formatting */ - help_emitsummary(t, s, d); + if (help_emitsummary(t, s, d)) + break; } else if (strcmp(topic, t)) { /* topic mismatch */ @@ -183,7 +184,8 @@ command_help(int argc, char *argv[]) } } else if ((subtopic == NULL) && (s != NULL)) { /* topic match, list subtopics */ - help_emitsummary(t, s, d); + if (help_emitsummary(t, s, d)) + break; } } free(t); -- cgit v1.1