summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2004-09-29 13:43:55 +0000
committerru <ru@FreeBSD.org>2004-09-29 13:43:55 +0000
commit581f87750d579ec06ce4ea823f92a6a3d6f093b6 (patch)
tree6d3ff49c15eca523e4f5bca82a85cea3d3941dbb /sys
parentdfef75a23f0108a2eac4e1c68456ab2b8fa5a526 (diff)
downloadFreeBSD-src-581f87750d579ec06ce4ea823f92a6a3d6f093b6.zip
FreeBSD-src-581f87750d579ec06ce4ea823f92a6a3d6f093b6.tar.gz
Fixed exiting from pager using the `q' key while paging
"help index" or "help <topic>" with list of subtopics.
Diffstat (limited to 'sys')
-rw-r--r--sys/boot/common/commands.c10
1 files changed, 6 insertions, 4 deletions
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);
OpenPOWER on IntegriCloud