From 31c0ddaa876f22274193f6656498d247e42236e6 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 1 Jan 2016 23:52:10 -0800 Subject: Bugfix: premature open of data source. match.c (open_data_source): complex_open was being called before the check against opening the data source because the query starting with a non-matching directive. This is moved down into a more nested scope. This bug was found thanks to complex_open now throwing exceptions. --- match.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/match.c b/match.c index 5d312e27..cd57e946 100644 --- a/match.c +++ b/match.c @@ -3826,7 +3826,6 @@ static void open_data_source(match_files_ctx *c) val nothrow = tnil(ss_consp && car(source_spec) == nothrow_k); if (stringp(name)) { - val stream = complex_open(name, nil, nil); spec_bind (specline, first_spec, c->spec); if (consp(first_spec) && (gethash(non_matching_directive_table, @@ -3836,6 +3835,7 @@ static void open_data_source(match_files_ctx *c) "since query starts with non-matching " "directive."), name, nao); } else { + val stream = complex_open(name, nil, nil, nothrow); val spec = first(c->spec); debuglf(spec, lit("opening data source ~a"), name, nao); -- cgit v1.2.3