From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1EtWYc-0007Kl-2h for mharc-grub-devel@gnu.org; Mon, 02 Jan 2006 15:45:30 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EtWYa-0007Jp-Sg for grub-devel@gnu.org; Mon, 02 Jan 2006 15:45:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EtWYZ-0007HQ-8h for grub-devel@gnu.org; Mon, 02 Jan 2006 15:45:28 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EtWYZ-0007HN-4t for grub-devel@gnu.org; Mon, 02 Jan 2006 15:45:27 -0500 Received: from [194.109.24.31] (helo=smtp-vbr11.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EtWZf-0007k8-IH for grub-devel@gnu.org; Mon, 02 Jan 2006 15:46:35 -0500 Received: from localhost.localdomain (mgerards.xs4all.nl [82.92.27.129]) by smtp-vbr11.xs4all.nl (8.13.3/8.13.3) with ESMTP id k02KhkHt005107 for ; Mon, 2 Jan 2006 21:43:46 +0100 (CET) (envelope-from mgerards@xs4all.nl) Mail-Copies-To: mgerards@xs4all.nl To: The development of GRUB 2 References: <43B1DD7E.5090905@omniflux.com> <878xtyjtxm.fsf@xs4all.nl> <43B98B57.3@omniflux.com> From: Marco Gerards Date: Mon, 02 Jan 2006 21:43:47 +0100 In-Reply-To: <43B98B57.3@omniflux.com> (omniflux+lists@omniflux.com's message of "Mon, 02 Jan 2006 13:21:43 -0700") Message-ID: <87vex2icn0.fsf@xs4all.nl> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner Subject: Re: [PATCH] User definable terminfo support 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: Mon, 02 Jan 2006 20:45:29 -0000 Omniflux writes: > Marco Gerards wrote: >> Here is the review of the code that I promised. Please see my other >> email about generic comments. > > What is the subject line of this message? I sadly do not read all > messages on this list. You just answered it, so I guess you found it. ;-) >> You can put the string on a new line. If the string is still too long >> you can make two strings out of it, like: >> grub_error (FOO, >> "bar" >> "baz"); > > grub_error (FOO, "bar" "baz"); > No operator or separator between strings? Right. That will concatenate them and result in the string "barbaz". >>>+ ti->name = grub_strdup (args[0]); >> Typo. > > Can you be more specific? This looks correct to me... Can you change that to: ti->name = grub_strdup (args[0]); (So only one space before `=') >>>+static void >>>+setup_defaults (void) >>>+{ >>>+ terminfo_t *ti; >>>+ >>>+ ti = (terminfo_t *) grub_malloc (sizeof (terminfo_t)); >>>+ /* Do I need to test if malloc succeeded here? What do I do if it did not? */ >> Good one :-) >> In that case default could be set to NULL, if that is allowed? > > I think in this case, there will be many other problems. I think the > best thing in this case will be, as you suggest, to set the definition > to NULL and have all terminfo functions return their strings > unmodified. > > The only consequence to this I can think of is loss of menu support on > terminals which depend on terminfo (serial), and should be a rare case > even there. Another thing you could do is not malloc'ing memory, but using a pointer to a pre-defined struct instead. When free'ing you need a special case to check if it is this pre-defined struct. -- Marco