From 70f84f0b4d463049ee3be0e37c254d5a7cf931ac Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 5 Mar 2014 23:48:58 -0800 Subject: Fixing regression caused by the 2014-02-19 change ("Fixed long-running issue ..."). * match.c (open_data_source): if c->data is t, but c->files is nil, set c->data to nil: we cannot possibly open anything later. (match_files): We need to call open_data_source one more time just before processing a line with horizontal material. The previous call(s) to open_data_source might not have opened anything. Before accesing car(c.data) the correct test is consp(c.data), not c.data. In the else clause, we now specificially check for nilp(c.data) which is the correct indicator of no more data. If c.data is any other atom at that point, we have an internal error, for which an assertion is added now. --- ChangeLog | 16 ++++++++++++++++ match.c | 10 ++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 112fffd0..c78565f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2014-03-05 Kaz Kylheku + + Fixing regression caused by the 2014-02-19 change ("Fixed long-running + issue ..."). + + * match.c (open_data_source): if c->data is t, but c->files + is nil, set c->data to nil: we cannot possibly open anything later. + (match_files): We need to call open_data_source one more time just + before processing a line with horizontal material. The previous + call(s) to open_data_source might not have opened anything. Before + accesing car(c.data) the correct test is consp(c.data), not c.data. In + the else clause, we now specificially check for nilp(c.data) which is + the correct indicator of no more data. If c.data is any other atom at + that point, we have an internal error, for which an assertion is added + now. + 2014-03-05 Kaz Kylheku * stream.c (vformat): Fix broken parsing of parameteric width and diff --git a/match.c b/match.c index dd9cbc42..bd2666e4 100644 --- a/match.c +++ b/match.c @@ -3699,6 +3699,8 @@ static void open_data_source(match_files_ctx *c) } else { c->data = nil; } + } else if (c->data == t && c->files == nil) { + c->data = nil; } } @@ -3753,7 +3755,9 @@ repeat_spec_same_data: } } - if (c.data && car(c.data)) + open_data_source(&c); + + if (consp(c.data) && car(c.data)) { val dataline = car(c.data); @@ -3766,9 +3770,11 @@ repeat_spec_same_data: debug_return (nil); c.bindings = new_bindings; - } else { + } else if (nilp(c.data)) { debuglf(specline, lit("spec ran out of data"), nao); debug_return (nil); + } else { + internal_error("bug in data stream opening logic"); } } -- cgit v1.2.3