summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--match.c3
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c9ed4ec2..1cb5986d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-09-10 Kaz Kylheku <kaz@kylheku.com>
+
+ * 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 <kaz@kylheku.com>
* 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;