~emersion/mrsh

96e8a9052376e5c720235d3369e9dc1d994708b2 — Simon Ser 9 months ago ad88878
parser/word: fix parser not failing on some errors in back-quotes
1 files changed, 6 insertions(+), 7 deletions(-)

M parser/word.c
M parser/word.c => parser/word.c +6 -7
@@ 503,13 503,12 @@ struct mrsh_word *back_quotes(struct mrsh_parser *parser) {
		goto error;
	}
	struct mrsh_program *prog = mrsh_parse_program(subparser);
	if (prog == NULL) {
		const char *err_msg = mrsh_parser_error(subparser, NULL);
		if (err_msg != NULL) {
			// TODO: how should we handle subparser error position?
			parser_set_error(parser, err_msg);
			goto error;
		}
	const char *err_msg = mrsh_parser_error(subparser, NULL);
	if (err_msg != NULL) {
		// TODO: how should we handle subparser error position?
		parser_set_error(parser, err_msg);
		mrsh_program_destroy(prog);
		goto error;
	}
	mrsh_parser_destroy(subparser);