summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-09-10 21:13:22 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-09-10 21:13:22 -0700
commitccb0a9eec81a219cb87bc25ea179bf1636a1df8a (patch)
tree5a8aac1bcc30413075a44ea0e09968754b13c579 /match.c
parent3c04bc8c55b8ce961b830126846da18ce4767d7b (diff)
downloadtxr-ccb0a9eec81a219cb87bc25ea179bf1636a1df8a.tar.gz
txr-ccb0a9eec81a219cb87bc25ea179bf1636a1df8a.tar.bz2
txr-ccb0a9eec81a219cb87bc25ea179bf1636a1df8a.zip
* 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.
Diffstat (limited to 'match.c')
-rw-r--r--match.c3
1 files changed, 2 insertions, 1 deletions
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;