From 013bf20025957f1b812f0c6e50f8d7afa215e1a3 Mon Sep 17 00:00:00 2001 From: Alan Dunn Date: Wed, 2 Mar 2016 08:59:03 -0800 Subject: Allow evaluation of arbitrarily-positioned arguments in GRUB2 parser GRUB2 allows essentially arbitrary numbers of positional arguments, so ensure that they can be evaluated within scripts. GRUB2 also appears to support arbitrary numbers of leading 0's in positional parameters (i.e., $01 should evalute the same as $1), but this doesn't seem like a particularly important case to support. Tested: Modified test-grub2-pos-param to cover higher-numbered positional arguments. Signed-off-by: Alan Dunn Signed-off-by: Samuel Mendoza-Jonas --- discover/grub2/grub2-lexer.l | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'discover/grub2/grub2-lexer.l') diff --git a/discover/grub2/grub2-lexer.l b/discover/grub2/grub2-lexer.l index 81dc5fe..b55a715 100644 --- a/discover/grub2/grub2-lexer.l +++ b/discover/grub2/grub2-lexer.l @@ -24,7 +24,8 @@ void yyerror(struct grub2_parser *parser, const char *fmt, ...); WORD [^{}|&$;<> \t\n'"#]+ DELIM [ \t]+ BLANK ["]{2}|[']{2} -VARNAME ([[:alpha:]][_[:alnum:]]*|[0-9]|[\?@\*#]) +NUMBER 0|[1-9][0-9]* +VARNAME ([[:alpha:]][_[:alnum:]]*|{NUMBER}|[\?@\*#]) %% -- cgit v1.2.1