Merge from trunk revision 1572: This patch fixes the parser's lexer to

not passthrough other invalid characters in variable declarations. It
also adds testcases demonstrating the issue.

Nominated-By: Steve Beattie <sbeattie@ubuntu.com>
This commit is contained in:
Steve Beattie 2011-01-14 16:55:20 -06:00
parent d7e06b79bb
commit c1a11fb8b6
5 changed files with 45 additions and 0 deletions

View file

@ -390,6 +390,11 @@ LT_EQUAL <=
current_lineno++;
BEGIN(INITIAL);
}
[^\n] {
DUMP_PREPROCESS;
/* Something we didn't expect */
yyerror(_("Found unexpected character: '%s'"), yytext);
}
}
<NETWORK_MODE>{

View file

@ -0,0 +1,10 @@
#=DESCRIPTION trailing garbage should trigger an error
#=EXRESULT FAIL
@{LIBVIRT} = "libvirt
/does/not/exist {
change_profile ->
@{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*,
}

View file

@ -0,0 +1,10 @@
#=DESCRIPTION garbage should trigger an error
#=EXRESULT FAIL
@{LIBVIRT} = lib"virt
/does/not/exist {
change_profile ->
@{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*,
}

View file

@ -0,0 +1,10 @@
#=DESCRIPTION garbage should trigger an error
#=EXRESULT FAIL
@{LIBVIRT} = lib!virt libfail
/does/not/exist {
change_profile ->
@{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*,
}

View file

@ -0,0 +1,10 @@
#=DESCRIPTION trailing garbage should trigger an error
#=EXRESULT FAIL
@{LIBVIRT} = libvirt"
/does/not/exist {
change_profile ->
@{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*,
}