From 2847977c6db4c308d98657681151eca539052e89 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 13 Aug 2021 17:53:48 +0200 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- interpreter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interpreter.c b/interpreter.c index e4bca1a..77dc279 100644 --- a/interpreter.c +++ b/interpreter.c @@ -520,7 +520,7 @@ push_variable_substitution_argument(struct parser_context *ctx, struct command * } } else if (ctx->interpreter_state->requirement == NEED_INDEX_OR_OPERATOR_OR_END) { - if (s[0] == '[') { + if (s[0] == '[' && check_extension("[", line_number)) { ctx->interpreter_state->requirement = NEED_OPERATOR_OR_END; index: /* TODO push INDEX substate that exits on ] */ @@ -556,7 +556,7 @@ push_variable_substitution_argument(struct parser_context *ctx, struct command * } else if (ctx->interpreter_state->requirement == NEED_INDEX_OR_SUFFIX_OR_END) { ctx->interpreter_state->requirement = NEED_END; - if (s[0] == '[') { + if (s[0] == '[') { /* Do not check if extensions are allowed, cannot reach this code otherwise */ goto index; } else if (s[0] == '*' || s[0] == '@') { push_operator(ctx, argument, s, 1); -- cgit v1.2.3-70-g09d2