From: J.J. Tolton Date: Fri, 7 Nov 2025 00:39:21 +0000 (-0500) Subject: Fix bug where -t argument was processed as filename X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=31247545c3331ffff00368802f1e36abd4735c99;p=scryer-prolog.git Fix bug where -t argument was processed as filename Fixed issue where `scryer-prolog -t halt` would try to load "halt.pl" as a file instead of just using halt as the custom toplevel. The bug was caused by an extra clause `delegate_task([], []).` that would return control to the calling context instead of continuing to start_toplevel. This caused the argument processing in delegate_task to continue and treat the already-consumed toplevel argument as a filename. Removing this clause ensures that delegate_task([], Goals0) always proceeds to load initialization files and start the toplevel, fixing the double-processing bug. Co-Authored-By: J.J.'s Robot --- diff --git a/src/toplevel.pl b/src/toplevel.pl index 18f5c799..281c2364 100644 --- a/src/toplevel.pl +++ b/src/toplevel.pl @@ -71,7 +71,6 @@ arg_consults_goals(c(Mod), Args, [c(Mod)|Consults], Goals) :- arg_consults_goals(g(Goal), Args, Consults, [g(Goal)|Goals]) :- args_consults_goals(Args, Consults, Goals). -delegate_task([], []). delegate_task([], Goals0) :- (\+ disabled_init_file -> load_scryerrc ; true), reverse(Goals0, Goals1),