From 3a91828748385d8d6f7f44712eeaa84b826d073b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 2 Jul 2019 10:19:06 -0700 Subject: @{var1 var2}: bugfix: broken when var2 is regex. * match.c (h_var): When processing variable bound over a regex or text match, if that datum came from a modifier which was a variable, we must process the substituted modifier, not the original variable symbol. This is a regression that was introduced on November 16, 2011, in commit b86a599bbfcd591f64f31ddfc9ab1a659d39a7c0: "Variable matches can span over function calls.". Reported by user vapnik spaknik. --- match.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'match.c') diff --git a/match.c b/match.c index 200a1fea..1e0e00e7 100644 --- a/match.c +++ b/match.c @@ -663,7 +663,7 @@ static val h_var(match_line_ctx *c) return repeat_spec_k; } else if (consp(modifier) || regexp(modifier)) { /* var bound over text matched by form */ cons_bind (new_bindings, new_pos, - match_line(ml_specline(*c, modifiers))); + match_line(ml_specline(*c, cons(modifier, nil)))); if (!new_pos) { LOG_MISMATCH("var spanning form"); -- cgit v1.2.3