diff options
author | Jan Kloetzke <jan.kloetzke@freenet.de> | 2011-11-01 19:17:01 +0100 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-11-01 22:00:15 +0100 |
commit | b10224be6284a522b384f2319d00432629c1e7dc (patch) | |
tree | f8397e3a74f1e558323f86ab1ebc3c5b8b4510b0 /src | |
parent | 9197e70bd7f442576eb76fab4011fa36b8739960 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_utils.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index a32adfd..ce84a57 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -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. |