* Re: [bug #27695] parser.sh ignores the closing quote when preceeded by a variable
[not found] <20091013-211116.sv74720.58002@savannah.gnu.org>
@ 2009-10-15 13:28 ` Vladimir 'phcoder' Serbinenko
2009-10-16 18:35 ` Robert Millan
2009-12-06 22:57 ` Andreas Born
0 siblings, 2 replies; 3+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-10-15 13:28 UTC (permalink / raw)
To: The development of GRUB 2; +Cc: bug-grub, Andreas Born
[-- Attachment #1: Type: text/plain, Size: 1903 bytes --]
Andreas Born wrote:
> URL:
> <http://savannah.gnu.org/bugs/?27695>
>
> Summary: parser.sh ignores the closing quote when preceeded
> by a variable
>
Attached patch should fix this bug
> Project: GNU GRUB
> Submitted by: shador
> Submitted on: Di 13 Okt 2009 21:11:16 GMT
> Category: Terminal
> Severity: Major
> Priority: 5 - Normal
> Item Group: Software Error
> Status: None
> Privacy: Public
> Assigned to: None
> Originator Name:
> Originator Email:
> Open/Closed: Open
> Discussion Lock: Any
> Release:
> Release: SVN
> Reproducibility: Every Time
> Planned Release: None
>
> _______________________________________________________
>
> Details:
>
> The problem is reproducible with this example:
>
>> set blub=blob
>> echo $blub
>>
> blob
>
>> echo "${blub}"
>>
> blob
>
>> echo "$blub"
>>
>>
> => fails, the closing quote is ignored
>
>> echo "$blub""
>>
> blob
> => works as workaround
>
> The real trouble starts with strings containing spaces. But it can be fixed,
> as shown, by adding another quote at the end or using ${...}.
>
> This was tested with beta~4.
>
>
>
>
> _______________________________________________________
>
> Reply to this item at:
>
> <http://savannah.gnu.org/bugs/?27695>
>
> _______________________________________________
> Nachricht geschickt von/durch Savannah
> http://savannah.gnu.org/
>
>
>
> _______________________________________________
> Bug-grub mailing list
> Bug-grub@gnu.org
> http://lists.gnu.org/mailman/listinfo/bug-grub
>
>
--
Regards
Vladimir 'phcoder' Serbinenko
Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
[-- Attachment #2: varquote.diff --]
[-- Type: text/x-patch, Size: 1368 bytes --]
diff --git a/ChangeLog b/ChangeLog
index b0864a9..db30e9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2009-10-15 Vladimir Serbinenko <phcoder@gmail.com>
+ * script/sh/lexer.c (grub_script_yylex): Prevent character from changing
+ state twice.
+
+2009-10-15 Vladimir Serbinenko <phcoder@gmail.com>
+
* loader/i386/pc/xnu.c (grub_xnu_set_video): Fix loading splash image.
2009-10-15 Vladimir Serbinenko <phcoder@gmail.com>
diff --git a/script/sh/lexer.c b/script/sh/lexer.c
index a30e3c0..0c71dae 100644
--- a/script/sh/lexer.c
+++ b/script/sh/lexer.c
@@ -350,9 +350,11 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
if (! (check_varstate (newstate)))
{
if (state->state == GRUB_PARSER_STATE_VARNAME2
- || state->state == GRUB_PARSER_STATE_QVARNAME2)
- nextchar (state);
- state->state = newstate;
+ || state->state == GRUB_PARSER_STATE_QVARNAME2)
+ {
+ nextchar (state);
+ state->state = newstate;
+ }
break;
}
@@ -378,7 +380,6 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
buffer[bufpos++] = 0;
- state->state = newstate;
yylval->arg = grub_script_arg_add (parsestate, yylval->arg,
GRUB_SCRIPT_ARG_TYPE_VAR, buffer);
grub_dprintf ("scripting", "vartoken=`%s'\n", buffer);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [bug #27695] parser.sh ignores the closing quote when preceeded by a variable
2009-10-15 13:28 ` [bug #27695] parser.sh ignores the closing quote when preceeded by a variable Vladimir 'phcoder' Serbinenko
@ 2009-10-16 18:35 ` Robert Millan
2009-12-06 22:57 ` Andreas Born
1 sibling, 0 replies; 3+ messages in thread
From: Robert Millan @ 2009-10-16 18:35 UTC (permalink / raw)
To: The development of GRUB 2; +Cc: bug-grub, Andreas Born
On Thu, Oct 15, 2009 at 03:28:02PM +0200, Vladimir 'phcoder' Serbinenko wrote:
> diff --git a/script/sh/lexer.c b/script/sh/lexer.c
> index a30e3c0..0c71dae 100644
> --- a/script/sh/lexer.c
> +++ b/script/sh/lexer.c
> @@ -350,9 +350,11 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
> if (! (check_varstate (newstate)))
> {
> if (state->state == GRUB_PARSER_STATE_VARNAME2
> - || state->state == GRUB_PARSER_STATE_QVARNAME2)
> - nextchar (state);
> - state->state = newstate;
> + || state->state == GRUB_PARSER_STATE_QVARNAME2)
> + {
> + nextchar (state);
> + state->state = newstate;
> + }
> break;
> }
>
> @@ -378,7 +380,6 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
>
> buffer[bufpos++] = 0;
>
> - state->state = newstate;
> yylval->arg = grub_script_arg_add (parsestate, yylval->arg,
> GRUB_SCRIPT_ARG_TYPE_VAR, buffer);
> grub_dprintf ("scripting", "vartoken=`%s'\n", buffer);
Same here, I'm afraid.
--
Robert Millan
The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
how) you may access your data; but nobody's threatening your freedom: we
still allow you to remove your data and not access it at all."
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [bug #27695] parser.sh ignores the closing quote when preceeded by a variable
2009-10-15 13:28 ` [bug #27695] parser.sh ignores the closing quote when preceeded by a variable Vladimir 'phcoder' Serbinenko
2009-10-16 18:35 ` Robert Millan
@ 2009-12-06 22:57 ` Andreas Born
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Born @ 2009-12-06 22:57 UTC (permalink / raw)
To: GRUB2 Devel
[-- Attachment #1: Type: text/plain, Size: 2251 bytes --]
Problem exists still as of r1917. I've attached a rediffed version of
Vladimir's patch.
The behaviour without the patch changed (it's even more confusing), but
it's basically still the same:
grub> echo "$root"
grub>"
hd0,1
Vladimir 'phcoder' Serbinenko schrieb:
> Andreas Born wrote:
>
>> URL:
>> <http://savannah.gnu.org/bugs/?27695>
>>
>> Summary: parser.sh ignores the closing quote when preceeded
>> by a variable
>>
>>
> Attached patch should fix this bug
>
>> Project: GNU GRUB
>> Submitted by: shador
>> Submitted on: Di 13 Okt 2009 21:11:16 GMT
>> Category: Terminal
>> Severity: Major
>> Priority: 5 - Normal
>> Item Group: Software Error
>> Status: None
>> Privacy: Public
>> Assigned to: None
>> Originator Name:
>> Originator Email:
>> Open/Closed: Open
>> Discussion Lock: Any
>> Release:
>> Release: SVN
>> Reproducibility: Every Time
>> Planned Release: None
>>
>> _______________________________________________________
>>
>> Details:
>>
>> The problem is reproducible with this example:
>>
>>
>>> set blub=blob
>>> echo $blub
>>>
>>>
>> blob
>>
>>
>>> echo "${blub}"
>>>
>>>
>> blob
>>
>>
>>> echo "$blub"
>>>
>>>
>>>
>> => fails, the closing quote is ignored
>>
>>
>>> echo "$blub""
>>>
>>>
>> blob
>> => works as workaround
>>
>> The real trouble starts with strings containing spaces. But it can be fixed,
>> as shown, by adding another quote at the end or using ${...}.
>>
>> This was tested with beta~4.
>>
>>
>>
>>
>> _______________________________________________________
>>
>> Reply to this item at:
>>
>> <http://savannah.gnu.org/bugs/?27695>
>>
>> _______________________________________________
>> Nachricht geschickt von/durch Savannah
>> http://savannah.gnu.org/
>>
>>
>>
>> _______________________________________________
>> Bug-grub mailing list
>> Bug-grub@gnu.org
>> http://lists.gnu.org/mailman/listinfo/bug-grub
>>
>>
>>
>
>
>
[-- Attachment #2: varquote.diff --]
[-- Type: text/x-patch, Size: 757 bytes --]
=== modified file 'script/lexer.c'
--- script/lexer.c 2009-11-23 15:37:33 +0000
+++ script/lexer.c 2009-11-29 00:16:30 +0000
@@ -350,9 +350,11 @@
if (! (check_varstate (newstate)))
{
if (state->state == GRUB_PARSER_STATE_VARNAME2
- || state->state == GRUB_PARSER_STATE_QVARNAME2)
- nextchar (state);
- state->state = newstate;
+ || state->state == GRUB_PARSER_STATE_QVARNAME2)
+ {
+ nextchar (state);
+ state->state = newstate;
+ }
break;
}
@@ -378,7 +380,6 @@
buffer[bufpos++] = 0;
- state->state = newstate;
yylval->arg = grub_script_arg_add (parsestate, yylval->arg,
GRUB_SCRIPT_ARG_TYPE_VAR, buffer);
grub_dprintf ("scripting", "vartoken=`%s'\n", buffer);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-06 22:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20091013-211116.sv74720.58002@savannah.gnu.org>
2009-10-15 13:28 ` [bug #27695] parser.sh ignores the closing quote when preceeded by a variable Vladimir 'phcoder' Serbinenko
2009-10-16 18:35 ` Robert Millan
2009-12-06 22:57 ` Andreas Born
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.