All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marco Gerards <mgerards@xs4all.nl>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] make assumed terminal width on cmd help dynamic
Date: Sun, 20 Jul 2008 21:41:59 +0200	[thread overview]
Message-ID: <877ibgibqw.fsf@xs4all.nl> (raw)
In-Reply-To: <4BD4DF5CD2064035AC9DF15E29133A2D@fz> (Felix Zielcke's message of "Sun, 20 Jul 2008 20:52:13 +0200")

"Felix Zielcke" <fzielcke@z-51.de> writes:

> From: "Marco Gerards" <mgerards@xs4all.nl>
>
>>
>> It would be better to replace all users of TERM_WIDTH to use
>> GRUB_TERM_WIDTH, like you mentioned.  Only ugly thing is that this is
>> actually a function...
>>
>
> Here it is.
>
>
> Felix Zielcke <fzielcke@z-51.de>
>
>
> 	* commands/help.c: Include <grub/term.h>.
> 	(TERM_WIDTH): Removed.  Updated all uses.

I would say "Updated all users."  or perhaps even "Updated all
callers.".  English is not my native language, hopefully someone can
help us out ;-).

If this is updated, this patch can be applied as far as I am concerned :-)

> Index: commands/help.c
> ===================================================================
> --- commands/help.c     (Revision 1723)
> +++ commands/help.c     (Arbeitskopie)
> @@ -21,11 +21,8 @@
> #include <grub/dl.h>
> #include <grub/arg.h>
> #include <grub/misc.h>
> +#include <grub/term.h>
>
> -/* XXX: This has to be changed into a function so the screen can be
> -   optimally used.  */
> -#define TERM_WIDTH     80
> -
> static grub_err_t
> grub_cmd_help (struct grub_arg_list *state __attribute__ ((unused)), int argc,
>               char **args)
> @@ -43,16 +40,16 @@
>        {
>          if (cmd->flags & GRUB_COMMAND_FLAG_CMDLINE)
>            {
> -             char description[TERM_WIDTH / 2];
> +             char description[GRUB_TERM_WIDTH / 2];
>              int desclen = grub_strlen (cmd->summary);
>
> -             /* Make a string with a length of TERM_WIDTH / 2 - 1 filled
> +             /* Make a string with a length of GRUB_TERM_WIDTH / 2 - 1 filled
>                 with the description followed by spaces.  */
> -             grub_memset (description, ' ', TERM_WIDTH / 2 - 1);
> -             description[TERM_WIDTH / 2 - 1] = '\0';
> +             grub_memset (description, ' ', GRUB_TERM_WIDTH / 2 - 1);
> +             description[GRUB_TERM_WIDTH / 2 - 1] = '\0';
>              grub_memcpy (description, cmd->summary,
> -                          (desclen < TERM_WIDTH / 2 - 1
> -                           ? desclen : TERM_WIDTH / 2 - 1));
> +                          (desclen < GRUB_TERM_WIDTH / 2 - 1
> +                           ? desclen : GRUB_TERM_WIDTH / 2 - 1));
>
>              grub_printf ("%s%s", description, (cnt++) % 2 ? "\n" : " ");
>            }
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel




  reply	other threads:[~2008-07-20 19:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-20 13:47 [PATCH] make assumed terminal width on cmd help dynamic Felix Zielcke
2008-07-20 13:53 ` Felix Zielcke
2008-07-20 14:08 ` Felix Zielcke
2008-07-20 18:16 ` Marco Gerards
2008-07-20 18:52   ` Felix Zielcke
2008-07-20 19:41     ` Marco Gerards [this message]
2008-07-26  9:14       ` Marco Gerards
2008-07-27 13:03         ` Robert Millan
2008-07-27 15:50           ` Felix Zielcke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877ibgibqw.fsf@xs4all.nl \
    --to=mgerards@xs4all.nl \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.