From a8ceafbf4ca19de403c4c4b6df27e6faeb8f635b Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Wed, 25 Feb 2015 19:25:53 +0000 Subject: Port env var expension fix from rebar2 See https://github.com/rebar/rebar/pull/458 --- src/rebar_utils.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index ab5167f..0c95c69 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -293,7 +293,7 @@ expand_env_variable(InStr, VarName, RawVarValue) -> VarValue = re:replace(RawVarValue, "\\\\", "\\\\\\\\", ReOpts), %% Use a regex to match/replace: %% Given variable "FOO": match $FOO\s | $FOOeol | ${FOO} - RegEx = io_lib:format("\\\$(~s(\\s|$)|{~s})", [VarName, VarName]), + RegEx = io_lib:format("\\\$(~s(\\W|$)|{~s})", [VarName, VarName]), re:replace(InStr, RegEx, [VarValue, "\\2"], ReOpts) end. -- cgit v1.1