diff options
author | Mattias Andrée <maandree@kth.se> | 2021-08-13 17:53:48 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-08-13 17:53:48 +0200 |
commit | 2847977c6db4c308d98657681151eca539052e89 (patch) | |
tree | 6a30c2dcd6e2d41f899d16a50b3e78ca0e1d4407 | |
parent | Third commit (diff) | |
download | apsh-2847977c6db4c308d98657681151eca539052e89.tar.gz apsh-2847977c6db4c308d98657681151eca539052e89.tar.bz2 apsh-2847977c6db4c308d98657681151eca539052e89.tar.xz |
m
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | interpreter.c | 4 |
1 files 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); |