Fix including by path
This commit is contained in:
parent
51dd74dd7c
commit
15896a2318
@ -656,8 +656,14 @@ stdlib_options() ->
|
|||||||
|
|
||||||
get_include_code(File, Ann, Opts) ->
|
get_include_code(File, Ann, Opts) ->
|
||||||
case {read_file(File, Opts), read_file(File, stdlib_options())} of
|
case {read_file(File, Opts), read_file(File, stdlib_options())} of
|
||||||
{{ok, _}, {ok,_ }} ->
|
{{ok, Bin}, {ok, _}} ->
|
||||||
fail(ann_pos(Ann), "Illegal redefinition of standard library " ++ File);
|
case filename:basename(File) == File of
|
||||||
|
true -> { error
|
||||||
|
, fail( ann_pos(Ann)
|
||||||
|
, "Illegal redefinition of standard library " ++ binary_to_list(File))};
|
||||||
|
%% If a path is provided then the stdlib takes lower priority
|
||||||
|
false -> {ok, binary_to_list(Bin)}
|
||||||
|
end;
|
||||||
{_, {ok, Bin}} ->
|
{_, {ok, Bin}} ->
|
||||||
{ok, binary_to_list(Bin)};
|
{ok, binary_to_list(Bin)};
|
||||||
{{ok, Bin}, _} ->
|
{{ok, Bin}, _} ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user