diff -ur bash-3.2.orig/builtins/help.def bash-3.2.new/builtins/help.def --- bash-3.2.orig/builtins/help.def 2004-12-30 19:59:55.000000000 +0100 +++ bash-3.2.new/builtins/help.def 2006-12-20 18:39:20.000000000 +0100 @@ -175,8 +175,8 @@ static void show_builtin_command_help () { - int i, j; - char blurb[36]; + int i, j, k, height, width; + char blurb[71]; printf ( _("These shell commands are defined internally. Type `help' to see this list.\n\ @@ -187,21 +187,26 @@ A star (*) next to a name means that the command is disabled.\n\ \n")); - for (i = 0; i < num_shell_builtins; i++) + height = (num_shell_builtins + 1) / 2; + width = 40; /* XXX should use half of terminal width instead */ + if (width > 70) + width = 70; /* limit column width to this maximum */ + + for (i = 0; i < height; i++) { QUIT; - blurb[0] = (shell_builtins[i].flags & BUILTIN_ENABLED) ? ' ' : '*'; - strncpy (blurb + 1, shell_builtins[i].short_doc, 34); - blurb[35] = '\0'; - printf ("%s", blurb); - - if (i % 2) - printf ("\n"); - else - for (j = strlen (blurb); j < 35; j++) - putc (' ', stdout); + for (k = i; k < num_shell_builtins; k += height) /* two columns */ + { + blurb[0] = (shell_builtins[k].flags & BUILTIN_ENABLED) ? ' ' : '*'; + strncpy (blurb + 1, shell_builtins[k].short_doc, width - 1); + if (strlen (shell_builtins[k].short_doc) >= width) + blurb[width - 1] = '>'; /* indicate truncated string */ + blurb[width] = '\0'; + for (j = strlen (blurb); j < width; j++) + blurb[j]=' '; /* pad out any remaining width with spaces */ + printf ("%s", blurb); + } + printf ("\n"); } - if (i % 2) - printf ("\n"); } #endif /* HELP_BUILTIN */