Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1M0FtV-0000nX-Ve for mharc-grub-devel@gnu.org; Sat, 02 May 2009 10:08:46 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M0FtU-0000nJ-MV for grub-devel@gnu.org; Sat, 02 May 2009 10:08:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M0FtQ-0000kX-7Q for grub-devel@gnu.org; Sat, 02 May 2009 10:08:44 -0400 Received: from [199.232.76.173] (port=44675 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M0FtQ-0000kK-3D for grub-devel@gnu.org; Sat, 02 May 2009 10:08:40 -0400 Received: from ti-out-0910.google.com ([209.85.142.190]:47142) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M0FtP-0006I3-IB for grub-devel@gnu.org; Sat, 02 May 2009 10:08:39 -0400 Received: by ti-out-0910.google.com with SMTP id b6so312185tic.10 for ; Sat, 02 May 2009 07:08:36 -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 :content-transfer-encoding; bh=LoblbCWXRsK6I3VSmwD0OareIjtSMayAJ8/pdbaHuJ8=; b=qVK8m3NsRaXN+F6GbUofJOhVfX9bMEUGVmHs/c5XxTCLgNhBBXWPJjeHfwI+S2gGV9 Zd/AFFWIouD67zMpJjsQI1WdLir4NCxJPipvDRxu5sRPJ1LxB+OhXuQkDwXb7ApaUKrg /8Jpjhk67vGiFA/cCF+DMQTJyNNXx8hlq1EqU= 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:content-transfer-encoding; b=KrWmqBb++9IRHHImR2GTwnbMgPLQl30fQGwvfX0Zsz9S93J5HbdBKqaBU9hErFeP7b PNhfMFo1nngfa7gx2eMUNqxiYVKQ05ieh+i+I4p/++30NyMfemO2q12g1PRiweexSerd 3+cGdwKUn0zoKaS31N8Yr2OevGyxJwyOhfzis= MIME-Version: 1.0 Received: by 10.110.95.3 with SMTP id s3mr295629tib.37.1241273316074; Sat, 02 May 2009 07:08:36 -0700 (PDT) In-Reply-To: References: Date: Sat, 2 May 2009 22:08:36 +0800 Message-ID: From: Bean To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: Sat, 02 May 2009 14:08:44 -0000 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}, 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. 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, 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