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

Vladimir Serbinenko <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2325
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2325
Author:   phcoder
Date:     2009-06-15 21:05:50 +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 (check_textstate): accept GRUB_PARSER_STATE_ESC
	(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 21:04:17 UTC (rev 2324)
+++ trunk/grub2/script/sh/lexer.c	2009-06-15 21:05:50 UTC (rev 2325)
@@ -185,11 +185,18 @@
 		break;
 	      grub_dprintf ("scripting", "token=`\\n'\n");
 	      recordchar (state, '\n');
-	      if (state->state != GRUB_PARSER_STATE_ESC)
+	      if (state->state != GRUB_PARSER_STATE_ESC
+		  && state->state != GRUB_PARSER_STATE_DQUOTE
+		  && state->state != GRUB_PARSER_STATE_QUOTE)
 		{
 		  state->tokenonhold = '\n';
 		  break;
 		}
+	      if (state->state == GRUB_PARSER_STATE_DQUOTE
+		  || state->state == GRUB_PARSER_STATE_QUOTE)
+		yylval->arg = grub_script_arg_add (parsestate, yylval->arg,
+						   GRUB_SCRIPT_ARG_TYPE_STR,
+						   "\n");
 	    }
 	  else
 	    {
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.