[2324] 2009-06-15 Vladimir Serbinenko <[email protected]>

Vladimir Serbinenko <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2324
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2324
Author:   phcoder
Date:     2009-06-15 21:04:17 +0000 (Mon, 15 Jun 2009)
Log Message:
-----------
2009-06-15  Vladimir Serbinenko  <[email protected]>

	Fix handling of string like \"hello\" and "a
	b"

	* script/sh/lexer.c 
	(grub_script_yylex): fix parsing of quoting, escaping and newline

Modified Paths:
--------------
    trunk/grub2/script/sh/lexer.c

Modified: trunk/grub2/script/sh/lexer.c
===================================================================
--- trunk/grub2/script/sh/lexer.c	2009-06-15 20:59:55 UTC (rev 2323)
+++ trunk/grub2/script/sh/lexer.c	2009-06-15 21:04:17 UTC (rev 2324)
@@ -156,18 +156,20 @@
       return token;
     }
 
-  for (;! state->done && (*state->script || firstrun); firstrun = 0)
+  for (;! state->done; firstrun = 0)
     {
 
       if (! *state->script)
 	{
 	  /* Check if more tokens are requested by the parser.  */
 	  if (((state->refs && ! parsestate->err)
-	       || state->state == GRUB_PARSER_STATE_ESC)
+	       || state->state == GRUB_PARSER_STATE_ESC
+	       || state->state == GRUB_PARSER_STATE_QUOTE
+	       || state->state == GRUB_PARSER_STATE_DQUOTE)
 	      && state->getline)
 	    {
 	      int doexit = 0;
-	      while (!state->script || ! grub_strlen (state->script))
+	      while (!state->script || ! *state->script)
 		{
 		  grub_free (state->newscript);
 		  state->newscript = 0;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.