--- We could at least support 2-column layout for UTF-8 later. This is still useful as fallback for non-UTF8 locales.
Comments? builtins/help.def | 17 +++++++++++++++++ 1 tập tin đã bị thay đổi, 17 được thêm vào(+) diff --git a/builtins/help.def b/builtins/help.def index 8fb0e2b..3e7239a 100644 --- a/builtins/help.def +++ b/builtins/help.def @@ -342,6 +342,23 @@ Use `man -k' or `info' to find out more about commands not in this list.\n\ A star (*) next to a name means that the command is disabled.\n\ \n")); + /* + * Cheap trick to detect if we are not on C locale. Avoid 2-column + * layout because we may not (yet) reliably calculate the string + * width, now that one byte does not necessarily mean one column any + * more. + */ + if (strcmp(shell_builtins[0].short_doc, _(shell_builtins[0].short_doc))) + { + for (i = 0; i < num_shell_builtins; i++) + { + printf("%c %s\n", + shell_builtins[i].flags & BUILTIN_ENABLED ? ' ' : '*', + _(shell_builtins[i].short_doc)); + } + return; + } + t = get_string_value ("COLUMNS"); width = (t && *t) ? atoi (t) : 80; if (width <= 0) -- 1.7.12.289.g0ce9864