From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KKemS-0007PK-Qq for mharc-grub-devel@gnu.org; Sun, 20 Jul 2008 15:41:16 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KKemQ-0007MI-6x for grub-devel@gnu.org; Sun, 20 Jul 2008 15:41:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KKemP-0007LN-A4 for grub-devel@gnu.org; Sun, 20 Jul 2008 15:41:13 -0400 Received: from [199.232.76.173] (port=52085 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KKemP-0007LE-7U for grub-devel@gnu.org; Sun, 20 Jul 2008 15:41:13 -0400 Received: from smtp-vbr6.xs4all.nl ([194.109.24.26]:2571) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KKemO-0007jX-SK for grub-devel@gnu.org; Sun, 20 Jul 2008 15:41:13 -0400 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr6.xs4all.nl (8.13.8/8.13.8) with ESMTP id m6KJfBmC031105 for ; Sun, 20 Jul 2008 21:41:12 +0200 (CEST) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <89CD688385DC46C0B8A1049A6C2B14F4@fz> <873am4ju9t.fsf@xs4all.nl> <4BD4DF5CD2064035AC9DF15E29133A2D@fz> Mail-Copies-To: mgerards@xs4all.nl Date: Sun, 20 Jul 2008 21:41:59 +0200 In-Reply-To: <4BD4DF5CD2064035AC9DF15E29133A2D@fz> (Felix Zielcke's message of "Sun, 20 Jul 2008 20:52:13 +0200") Message-ID: <877ibgibqw.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 Subject: Re: [PATCH] make assumed terminal width on cmd help dynamic X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2008 19:41:14 -0000 "Felix Zielcke" writes: > From: "Marco Gerards" > >> >> 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 > > > * commands/help.c: Include . > (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 > #include > #include > +#include > > -/* 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