summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-18 22:02:02 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-18 22:02:02 -0800
commit9eddf1e4e0482ca8db81fcc4411fadd01190476c (patch)
tree48b39075e79160429c39f7e98fbfe2e0d1a70deb
parente4edb9aff778c683d81892cca705013dbe5dcc58 (diff)
downloadtxr-9eddf1e4e0482ca8db81fcc4411fadd01190476c.tar.gz
txr-9eddf1e4e0482ca8db81fcc4411fadd01190476c.tar.bz2
txr-9eddf1e4e0482ca8db81fcc4411fadd01190476c.zip
* match.c (match_line, match_files): Fix broken behavior of collect
that doesn't match anything.
-rw-r--r--ChangeLog12
-rw-r--r--match.c8
2 files changed, 13 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 883e35c2..29d3e4ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,16 @@
2009-11-18 Kaz Kylheku <kkylheku@gmail.com>
- parser.l (yyerror): Total breakage: can't take auto_str of char *
+ * match.c (match_line, match_files): Fix broken behavior of collect
+ that doesn't match anything. It is not a failed match, as the
+ documentation makes perfectly clear. Collect/coll were introduced
+ in txr-006 and had the proper non-failing semantics.
+ However, in txr-015, during code restructuring, a bug crept in.
+ When changing to a different debugiging function, for some reason
+ I added the nil returns.
+
+2009-11-18 Kaz Kylheku <kkylheku@gmail.com>
+
+ * parser.l (yyerror): Total breakage: can't take auto_str of char *
string.
(yyerrorf): Total breakage: arguments of wrong types. Detected
by vformat as garbage.
diff --git a/match.c b/match.c
index 08baf385..d8cc364a 100644
--- a/match.c
+++ b/match.c
@@ -471,10 +471,8 @@ obj_t *match_line(obj_t *bindings, obj_t *specline, obj_t *dataline,
}
- if (!bindings_coll) {
+ if (!bindings_coll)
debuglf(spec_lineno, lit("nothing was collected"), nao);
- return nil;
- }
for (iter = bindings_coll; iter; iter = cdr(iter)) {
obj_t *pair = car(iter);
@@ -1289,10 +1287,8 @@ repeat_spec_same_data:
return nil;
}
- if (!bindings_coll) {
+ if (!bindings_coll)
debuglf(spec_linenum, lit("nothing was collected"), nao);
- return nil;
- }
for (iter = bindings_coll; iter; iter = cdr(iter)) {
obj_t *pair = car(iter);