Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aBf7E-0002B9-GD for mharc-grub-devel@gnu.org; Wed, 23 Dec 2015 03:49:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBf7C-0002AU-G2 for grub-devel@gnu.org; Wed, 23 Dec 2015 03:49:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBf78-00080B-80 for grub-devel@gnu.org; Wed, 23 Dec 2015 03:49:46 -0500 Received: from victor.provo.novell.com ([137.65.250.26]:46398 helo=prv3-mh.provo.novell.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBf78-0007zF-0r for grub-devel@gnu.org; Wed, 23 Dec 2015 03:49:42 -0500 Received: from linux-dsax.tai.apac.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (TLS encrypted); Wed, 23 Dec 2015 01:49:35 -0700 Date: Wed, 23 Dec 2015 16:38:14 +0800 From: Michael Chang To: Andrei Borzenkov Subject: Re: [PATCH] normal: fix get_logical_num_lines Message-ID: <20151223083814.GA6961@linux-dsax.tai.apac.novell.com> Mail-Followup-To: Andrei Borzenkov , The development of GNU GRUB References: <20151223044505.GA28369@linux-dsax.tai.apac.novell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 137.65.250.26 Cc: The development of GNU GRUB X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 08:49:47 -0000 On Wed, Dec 23, 2015 at 09:26:43AM +0300, Andrei Borzenkov wrote: > On Wed, Dec 23, 2015 at 7:45 AM, Michael Chang wrote: > > In menu editing mode, grub2 shows bogus line if the character being > > edited is at last column of entry. This patch fixes the problem by > > having the get_logical_num_lines function to calculate correct number of > > lines. > > > > There is one more occurrence in update_screen (); could you check if > this needs fix too? > > grub_size_t t = grub_getstringwidth (linep->buf, linep->buf + screen->column, > term_screen->term); > y += t / (unsigned) term_screen->geo.entry_width; No, as the check followed has bailed it out. if (t % (unsigned) term_screen->geo.entry_width == 0 && t != 0 && screen->column == linep->len) y--; Of course, we can try to make the code more terse by the same fix so that we can remove the check. Should I submit a new patch for that ? Thanks, Michael