mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Fix unsafe use of var
This commit is contained in:
parent
8a046d898a
commit
b1d06a4d14
1 changed files with 17 additions and 16 deletions
|
@ -202,22 +202,23 @@ inspect(Source, IncludePath) ->
|
||||||
inspect_epp(Epp, Source, Module, Includes) ->
|
inspect_epp(Epp, Source, Module, Includes) ->
|
||||||
case epp:parse_erl_form(Epp) of
|
case epp:parse_erl_form(Epp) of
|
||||||
{ok, {attribute, _, module, ModInfo}} ->
|
{ok, {attribute, _, module, ModInfo}} ->
|
||||||
case ModInfo of
|
ActualModuleStr =
|
||||||
%% Typical module name, single atom
|
case ModInfo of
|
||||||
ActualModule when is_atom(ActualModule) ->
|
%% Typical module name, single atom
|
||||||
ActualModuleStr = atom_to_list(ActualModule);
|
ActualModule when is_atom(ActualModule) ->
|
||||||
%% Packag-ized module name, list of atoms
|
atom_to_list(ActualModule);
|
||||||
ActualModule when is_list(ActualModule) ->
|
%% Packag-ized module name, list of atoms
|
||||||
ActualModuleStr = string:join([atom_to_list(P) ||
|
ActualModule when is_list(ActualModule) ->
|
||||||
P <- ActualModule], ".");
|
string:join([atom_to_list(P) ||
|
||||||
%% Parameterized module name, single atom
|
P <- ActualModule], ".");
|
||||||
{ActualModule, _} when is_atom(ActualModule) ->
|
%% Parameterized module name, single atom
|
||||||
ActualModuleStr = atom_to_list(ActualModule);
|
{ActualModule, _} when is_atom(ActualModule) ->
|
||||||
%% Parameterized and packagized module name, list of atoms
|
atom_to_list(ActualModule);
|
||||||
{ActualModule, _} when is_list(ActualModule) ->
|
%% Parameterized and packagized module name, list of atoms
|
||||||
ActualModuleStr = string:join([atom_to_list(P) ||
|
{ActualModule, _} when is_list(ActualModule) ->
|
||||||
P <- ActualModule], ".")
|
string:join([atom_to_list(P) ||
|
||||||
end,
|
P <- ActualModule], ".")
|
||||||
|
end,
|
||||||
inspect_epp(Epp, Source, ActualModuleStr, Includes);
|
inspect_epp(Epp, Source, ActualModuleStr, Includes);
|
||||||
{ok, {attribute, 1, file, {Module, 1}}} ->
|
{ok, {attribute, 1, file, {Module, 1}}} ->
|
||||||
inspect_epp(Epp, Source, Module, Includes);
|
inspect_epp(Epp, Source, Module, Includes);
|
||||||
|
|
Loading…
Reference in a new issue