From: Mark Thom Date: Sat, 1 May 2021 02:38:26 +0000 (-0600) Subject: support full paths in load_context_path/2 (#916) X-Git-Tag: v0.9.0~94 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=14fc8e2efa9281d422166e43f5827fef4d29c912;p=scryer-prolog.git support full paths in load_context_path/2 (#916) --- diff --git a/src/loader.pl b/src/loader.pl index 6324e7cd..de6e8c53 100644 --- a/src/loader.pl +++ b/src/loader.pl @@ -463,7 +463,9 @@ use_module(Module, Exports) :- %% directory. Otherwise, use the relative path of Path. load_context_path(Module, Path) :- - ( prolog_load_context(directory, CurrentDir) -> + ( sub_atom(Module, 0, 1, _, '/') -> + Path = Module + ; prolog_load_context(directory, CurrentDir) -> % Rust's Path module never ends a directory path with '/', so % add one here. atom_concat(CurrentDir, '/', CurrentDirSlashed),