summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2004-09-29 13:43:55 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2004-09-29 13:43:55 +0000
commit4d0cb59f0fd69e1c5ca78f4b983866e66f768229 (patch)
tree6d3ff49c15eca523e4f5bca82a85cea3d3941dbb
parent9ccab60d32725aeb9e46ef5444034543b59623f1 (diff)
Notes
-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 38aa0a3deff8..5eb599c07acf 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);