2016-12-21 14:35:44 +0000, Stephane Chazelas: [...] > That sync_buffered_stream is meant to seek back to where we're > meant to resume reading the script when we've read more than > needed, but here b_inputp > b_used would suggest we've processed > code that is passed what we've read. Or more likely b_used has > incorrectly been set to 0. [...]
Looks like it should only be a matter of: diff --git a/input.c b/input.c index 308b87e4..a03911d3 100644 --- a/input.c +++ b/input.c @@ -504,7 +504,7 @@ b_fill_buffer (bp) nr = zread (bp->b_fd, bp->b_buffer, bp->b_size); if (nr <= 0) { - bp->b_used = 0; + bp->b_used = bp->b_inputp = 0; bp->b_buffer[0] = 0; if (nr == 0) bp->b_flag |= B_EOF; Though I've not done any testing other than it fixes that particular problem. -- Stephane