From ccb0a9eec81a219cb87bc25ea179bf1636a1df8a Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 10 Sep 2012 21:13:22 -0700 Subject: * match.c (v_collect): Bug in processing of @(last) directive. When a match for the @(last) material occured at the end of data, c->data was being mistakenly set to nil rather than t before breaking out of the loop, wreaking havoc. --- ChangeLog | 7 +++++++ match.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c9ed4ec2..1cb5986d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-09-10 Kaz Kylheku + + * match.c (v_collect): Bug in processing of @(last) directive. + When a match for the @(last) material occured at the end of data, + c->data was being mistakenly set to nil rather than t before breaking + out of the loop, wreaking havoc. + 2012-09-06 Kaz Kylheku * txr.1: Documented string library. diff --git a/match.c b/match.c index b7baa6b6..e1d74399 100644 --- a/match.c +++ b/match.c @@ -2692,7 +2692,8 @@ static val v_collect(match_files_ctx *c) last_bindings = set_diff(until_last_bindings, new_bindings, eq_f, nil); if (success == t) { - c->data = t; + debuglf(specline, lit("collect consumed entire file"), nao); + c->data = nil; } else { cons_bind (new_data, new_line, success); c->data = new_data; -- cgit v1.2.3