~emersion/mrsh

1558d22537bd8190281748fcbcaccce85845f333 — Mohamad Barbar 2 months ago 869eb63
Initialise arith_nested_parens every word list.
2 files changed, 1 insertions(+), 1 deletions(-)

M parser/parser.c
M parser/word.c
M parser/parser.c => parser/parser.c +0 -1
@@ 57,7 57,6 @@ static struct mrsh_parser *parser_create(void) {
	struct mrsh_parser *parser = calloc(1, sizeof(struct mrsh_parser));
	parser->fd = -1;
	parser->pos.line = parser->pos.column = 1;
	parser->arith_nested_parens = 0;
	return parser;
}


M parser/word.c => parser/word.c +1 -0
@@ 367,6 367,7 @@ static struct mrsh_word_arithmetic *expect_word_arithmetic(
	c = parser_read_char(parser);
	assert(c == '(');

	parser->arith_nested_parens = 0;
	struct mrsh_word *body = word_list(parser, 0, arithmetic_word);
	if (body == NULL) {
		if (!mrsh_parser_error(parser, NULL)) {