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-12 21:42:49.000000000 +0100 @@ -175,8 +175,8 @@ static void show_builtin_command_help () { - int i, j; - char blurb[36]; + int i, j, height, width; + char blurb[101]; printf ( _("These shell commands are defined internally. Type `help' to see this list.\n\ @@ -187,21 +187,33 @@ 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 better use half of screen width */ + + 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'; + strncpy (blurb + 1, shell_builtins[i].short_doc, width - 1 ); + blurb[width] = '\0'; + printf ("%s", blurb); + for (j = strlen (blurb); j < width; j++) + putc (' ', stdout); + + if ((i * 2) == num_shell_builtins) + { + printf ("\n"); + break; + } + + blurb[0] = (shell_builtins[i+height].flags & BUILTIN_ENABLED) ? ' ' : '*'; + strncpy (blurb + 1, shell_builtins[i+height].short_doc, width - 1); + blurb[width] = '\0'; printf ("%s", blurb); + for (j = strlen (blurb); j < width; j++) + putc (' ', stdout); - if (i % 2) - printf ("\n"); - else - for (j = strlen (blurb); j < 35; j++) - putc (' ', stdout); + printf ("\n"); } - if (i % 2) - printf ("\n"); } #endif /* HELP_BUILTIN */