aboutsummaryrefslogtreecommitdiff
path: root/sys/boot
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2004-11-10 20:30:06 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2004-11-10 20:30:06 +0000
commit5385ae7d026781038d496a1dbfb4fa773d4d64f3 (patch)
tree27cef5542b9e05e3bf802f5cfc984d19fab2189a /sys/boot
parent2d04c9706739ba66552ccb720c1ef65c6dd25680 (diff)
Notes
Diffstat (limited to 'sys/boot')
-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);