Skip to content

Commit

Permalink
end_of_file, re issue #620
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Nov 3, 2024
1 parent de4dbbe commit 0102b20
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/prolog.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,14 @@ bool pl_query(prolog *pl, const char *s, pl_sub_query **subq, unsigned int yield
if (!pl || !*s || !subq)
return false;

if (!pl->p)
pl->p = parser_create(pl->curr_m);
else
reset(pl->p);

pl->p = parser_create(pl->curr_m);
if (!pl->p) return false;
pl->p->command = true;
pl->is_query = true;
bool ok = run(pl->p, s, true, (query**)subq, yield_time_in_ms);
if (get_status(pl)) pl->curr_m = pl->p->m;
parser_destroy(pl->p);
pl->p = NULL;
return ok;
}

Expand Down

0 comments on commit 0102b20

Please sign in to comment.