diff options
author | Dave Thomas <dave@pragprog.com> | 2013-06-22 21:41:04 -0500 |
---|---|---|
committer | Dave Thomas <dave@pragprog.com> | 2013-06-22 21:41:04 -0500 |
commit | dd277fd01ac6da0661df878a123db93cd09f040e (patch) | |
tree | 1ac9aa0dd53dfb073cb053c948a1821fc62674d2 | |
parent | 934ec7fdeff99fe95220f8a187968d0f584585ab (diff) |
Fix crash when env vars contain utf8 chars
-rw-r--r-- | src/rebar_utils.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 9c7c064..2731761 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -191,12 +191,12 @@ expand_env_variable(InStr, VarName, RawVarValue) -> %% No variables to expand InStr; _ -> - VarValue = re:replace(RawVarValue, "\\\\", "\\\\\\\\", [global, unicode]), + ReOpts = [global, unicode], + 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]), - ReOpts = [global, {return, list}, unicode], - re:replace(InStr, RegEx, [VarValue, "\\2"], ReOpts) + re:replace(InStr, RegEx, [VarValue, "\\2"], ReOpts ++ [{return, list}]) end. vcs_vsn(Config, Vcs, Dir) -> |