mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Fix rebar_utils:expand_env_variable/3
The function may fail with a badarg exception because the first regex returns an iolist() which is allowed to be a improper list. In this case '++' cannot append to the iolist. The correct way to append something to an iolist() is [iolist(), "tail"] because iolist's are allowed to be arbitrarily deep lists.
This commit is contained in:
parent
9197e70bd7
commit
b10224be62
1 changed files with 1 additions and 1 deletions
|
@ -196,7 +196,7 @@ expand_env_variable(InStr, VarName, RawVarValue) ->
|
|||
%% Given variable "FOO": match $FOO\s | $FOOeol | ${FOO}
|
||||
RegEx = io_lib:format("\\\$(~s(\\s|$)|{~s})", [VarName, VarName]),
|
||||
ReOpts = [global, {return, list}],
|
||||
re:replace(InStr, RegEx, VarValue ++ "\\2", ReOpts)
|
||||
re:replace(InStr, RegEx, [VarValue, "\\2"], ReOpts)
|
||||
end.
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue