浏览代码

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.
pull/3/head
Jan Kloetzke 13 年前
提交者 Tuncer Ayaz
父节点
当前提交
b10224be62
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      src/rebar_utils.erl

+ 1
- 1
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.

正在加载...
取消
保存