From 9eddf1e4e0482ca8db81fcc4411fadd01190476c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 18 Nov 2009 22:02:02 -0800 Subject: * match.c (match_line, match_files): Fix broken behavior of collect that doesn't match anything. --- ChangeLog | 12 +++++++++++- match.c | 8 ++------ 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 - 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 + + * 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); -- cgit v1.2.3