From: Glenn Washburn <development@efficientek.com>
To: grub-devel@gnu.org
Cc: Glenn Washburn <development@efficientek.com>
Subject: [PATCH] script: Do not allow a delimiter between function name and block start.
Date: Fri, 31 Jul 2020 09:33:22 -0500 [thread overview]
Message-ID: <20200731143323.1650165-5-development@efficientek.com> (raw)
In-Reply-To: <20200731143323.1650165-1-development@efficientek.com>
Currently the following is valid syntax, but should be a syntax error:
grub> function f; { echo HERE; }
grub> f
HERE
This fix is not backward compatible, but current syntax is not documented
either and has no functional value. So any scripts with this unintended
syntax are technically syntactically incorrect and should not be relying
on this behavior.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
grub-core/script/parser.y | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/script/parser.y b/grub-core/script/parser.y
index f80b86b6f..4a18ab7ba 100644
--- a/grub-core/script/parser.y
+++ b/grub-core/script/parser.y
@@ -279,7 +279,7 @@ function: "function" "name"
$<scripts>$ = state->scripts;
state->scripts = 0;
}
- delimiters0 "{" commands1 delimiters1 "}"
+ newlines0 "{" commands1 delimiters1 "}"
{
struct grub_script *script;
state->func_mem = grub_script_mem_record_stop (state,
--
2.25.1
next prev parent reply other threads:[~2020-07-31 14:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-31 14:33 [PATCH] error: Do compile-time format string checking on grub_error Glenn Washburn
2020-07-31 14:33 ` [PATCH] cryptodisk: Use cipher name instead of object in error message Glenn Washburn
2020-09-17 14:30 ` Daniel Kiper
2020-07-31 14:33 ` [PATCH] lexer: char const * should be const char * Glenn Washburn
2020-09-17 14:33 ` Daniel Kiper
2020-07-31 14:33 ` [PATCH] docs/grub: Support for loading and concatenating multiple initrds Glenn Washburn
2020-09-17 14:36 ` Daniel Kiper
2020-07-31 14:33 ` Glenn Washburn [this message]
2020-09-17 14:40 ` [PATCH] script: Do not allow a delimiter between function name and block start Daniel Kiper
2020-07-31 14:33 ` [PATCH] crypto: Remove GPG_ERROR_CFLAGS from gpg_err_code_t enum Glenn Washburn
2020-09-17 14:42 ` Daniel Kiper
2020-09-17 14:29 ` [PATCH] error: Do compile-time format string checking on grub_error Daniel Kiper
2020-10-03 22:34 ` Glenn Washburn
2020-10-05 6:12 ` Glenn Washburn
2020-10-05 6:17 ` Glenn Washburn
2020-11-08 5:26 ` [PATCH v2 0/2] " Glenn Washburn
2020-11-08 5:26 ` [PATCH v2 1/2] error: Fix issues mostly related to incorrect length modifiers in calls to grub_error() Glenn Washburn
2020-11-08 5:26 ` [PATCH v2 2/2] error: Do compile-time format string checking on grub_error Glenn Washburn
2020-11-23 9:31 ` [PATCH v2 0/2] " Glenn Washburn
2020-12-01 5:59 ` Glenn Washburn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200731143323.1650165-5-development@efficientek.com \
--to=development@efficientek.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.