summaryrefslogtreecommitdiffstats
path: root/sys/ddb/db_command.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2006-10-08 18:15:08 +0000
committerbde <bde@FreeBSD.org>2006-10-08 18:15:08 +0000
commitff5fb7910a5f1cf6327ac47939d4fadc117a4701 (patch)
tree9e69099aed086269ab338b986781b6629a9787c9 /sys/ddb/db_command.c
parentd3f48a8444029c6e96b2ad642d6448b598cf2b64 (diff)
downloadFreeBSD-src-ff5fb7910a5f1cf6327ac47939d4fadc117a4701.zip
FreeBSD-src-ff5fb7910a5f1cf6327ac47939d4fadc117a4701.tar.gz
Fixed formatting of printing of command tables. WIth the default max
output width of 79, only 6 columns of width 12 each fit, but 7 columns were printed. The fix is to pass the width of the next output to db_end_line() and not assume there that this width is always 1. Related unfixed bugs: - 1 character is wasted for a space after the last column - suppression of trailing spaces used to limit the misformatting, but seems to have been lost - in db_examine(), the width of the next output is not know and is still assumed to be 1.
Diffstat (limited to 'sys/ddb/db_command.c')
-rw-r--r--sys/ddb/db_command.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index 5494c84..79143f1 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -266,14 +266,14 @@ db_cmd_list(table)
for (cmd = table->table; cmd->name != 0; cmd++) {
db_printf("%-12s", cmd->name);
- db_end_line();
+ db_end_line(12);
}
if (table->aux_tablep == NULL)
return;
for (aux_cmdp = table->aux_tablep; aux_cmdp < table->aux_tablep_end;
aux_cmdp++) {
db_printf("%-12s", (*aux_cmdp)->name);
- db_end_line();
+ db_end_line(12);
}
}
OpenPOWER on IntegriCloud