support full paths in load_context_path/2 (#916)

This commit is contained in:
Mark Thom
2021-04-30 20:38:26 -06:00
parent d8bd4fbea6
commit 14fc8e2efa

View File

@@ -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),