Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1M0XkC-0005mW-U5 for mharc-grub-devel@gnu.org; Sun, 03 May 2009 05:12:21 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M0XkB-0005mJ-NS for grub-devel@gnu.org; Sun, 03 May 2009 05:12:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M0Xk7-0005m2-Al for grub-devel@gnu.org; Sun, 03 May 2009 05:12:19 -0400 Received: from [199.232.76.173] (port=51499 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M0Xk7-0005lz-75 for grub-devel@gnu.org; Sun, 03 May 2009 05:12:15 -0400 Received: from mail-ew0-f162.google.com ([209.85.219.162]:55686) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M0Xk6-0005sq-Oa for grub-devel@gnu.org; Sun, 03 May 2009 05:12:15 -0400 Received: by ewy6 with SMTP id 6so3320704ewy.42 for ; Sun, 03 May 2009 02:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=MHpo/ScCeaoV7AssQGfSldSbqbl8jFLHkZOLAXBmWN0=; b=UZ7x1t3T88U9Y2ZmoLsZDFd2FjDATqMcac92jOIufPYDkuAYRDsutBfTFTuweuQ6VB Xk2Zu7vwgTJETHv+mjMxbEu7ch1B51jOQIzBzQB8apVzg0w0eV1bvSljorZfFUgGWF1y OD0QfJDACd9StGMCnAxYi/vR1aA569UU+sAAE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rPqcLgnUM+iK/DpoZZufgF6yrOK7PHjzD3ChRVFX+vKsLzcuWTOc2EsMaskhRdxyQV VExLLDXHYi7kbT9JaXOvulTdaxtICTPL81AjKRq7hgVgRQYyvFfKwh0ofQoS1JrQmOa/ hvxyWOwW0AM9RWLjVlM6uj2XkkEmJN3fc2t50= MIME-Version: 1.0 Received: by 10.211.166.2 with SMTP id t2mr3316621ebo.42.1241341934014; Sun, 03 May 2009 02:12:14 -0700 (PDT) In-Reply-To: References: Date: Sun, 3 May 2009 11:12:14 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: multipart/alternative; boundary=0015174c3f0c0590a10468fe716e X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [BUGFIX] lexer waits for space to terminate the varname 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, 03 May 2009 09:12:20 -0000 --0015174c3f0c0590a10468fe716e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello On Sat, May 2, 2009 at 4:08 PM, Bean wrote: > Hi, > > I think there is problem with this patch. Consider ${aa}, the closing > character "}" would be left out. > > Although you can remedy this by swapping: > > { GRUB_PARSER_STATE_VARNAME, GRUB_PARSER_STATE_TEXT, ' ', 1}, > { GRUB_PARSER_STATE_VARNAME2, GRUB_PARSER_STATE_TEXT, '}', 0}, > It's not the same starting state. However similar issue exists with ' ' and '\"' > > so that '}' would be handled before ' ', but it's still not a good > practice, as you have added a logic in code that would depend on the > order of state_transitions, which is not apparent for casual code > viewer. Perhaps we should switch to just ordering the transition rules instead of separate code for default value > Also, ' ' might be used for other transition in the future, > this code could break that. I suggest you use {} to enclose the > variable that doesn't terminated with space, It can be a workaround but the bug is still here. The following pieces of code fail: 1) echo $hello; 2) echo $hello or add the terminating > character explicitly in the transition table: > > > { GRUB_PARSER_STATE_VARNAME, GRUB_PARSER_STATE_TEXT, '/ ', 1}, > > > On Sat, May 2, 2009 at 8:02 PM, Vladimir 'phcoder' Serbinenko > wrote: > > Hello. A varname may be terminated by any character which isn't in a set > > [A-Za-z0-9_] and not only space. Here is a fix > > > > -- > > Regards > > Vladimir 'phcoder' Serbinenko > > > > _______________________________________________ > > Grub-devel mailing list > > Grub-devel@gnu.org > > http://lists.gnu.org/mailman/listinfo/grub-devel > > > > > > > > -- > Bean > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > -- Regards Vladimir 'phcoder' Serbinenko --0015174c3f0c0590a10468fe716e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello

On Sat, May 2, 2009 at 4:08 PM, Bea= n <bean123ch@gm= ail.com> wrote:
Hi,

I think there is problem with this patch. Consider ${aa}, the closing
character "}" would be left out.

Although you can remedy this by swapping:

=A0{ GRUB_PARSER_STATE_VARNAME, GRUB_PARSER_STATE_TEXT, ' ', 1}, =A0{ GRUB_PARSER_STATE_VARNAME2, GRUB_PARSER_STATE_TEXT, '}', 0},<= br>
It's not the same starting state. However similar iss= ue exists with ' ' and '\"'

so that '}' would be handled before ' ', but it's still= not a good
practice, as you have added a logic in code that would depend on the
order of state_transitions, which is not apparent for casual code
viewer.
Perhaps we should switch to just ordering the tra= nsition rules instead of separate code for default value
Also, ' ' might be used for other transition in the future,
this code could break that. I suggest you use {} to enclose the
variable that doesn't terminated with space,
It can b= e a workaround=A0 but the bug is still here. The following pieces of code f= ail:
1) echo $hello;
2) echo $hello

or add the terminating
character explicitly in the transition table:


=A0{ GRUB_PARSER_STATE_VARNAME, GRUB_PARSER_STATE_TEXT, '/ ', 1},<= br>


On Sat, May 2, 2009 at 8:02 PM, Vladimir 'phcoder' Serbinenko
<phcoder@gmail.com> wrote: > Hello. A varname may be terminated by any character which isn't in= a set
> [A-Za-z0-9_] and not only space. Here is a fix
>
> --
> Regards
> Vladimir 'phcoder' Serbinenko
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>



--
Bean


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel



--
Regards
Vladi= mir 'phcoder' Serbinenko
--0015174c3f0c0590a10468fe716e--