diff options
author | Dave Thomas <dave@pragprog.com> | 2013-06-23 20:30:38 -0500 |
---|---|---|
committer | Dave Thomas <dave@pragprog.com> | 2013-06-23 20:30:38 -0500 |
commit | 091405bce7a59769a86fcbf8e44602c05b7082a1 (patch) | |
tree | e904f60a2d3425ff51cc847838e3c9bbe62a3990 | |
parent | dd277fd01ac6da0661df878a123db93cd09f040e (diff) |
Fix crsh with Unicode in environment vars
-rw-r--r-- | src/rebar_utils.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 2731761..64ac4a9 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; _ -> - ReOpts = [global, unicode], + ReOpts = [global, unicode, {return, list}], 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]), - re:replace(InStr, RegEx, [VarValue, "\\2"], ReOpts ++ [{return, list}]) + re:replace(InStr, RegEx, [VarValue, "\\2"], ReOpts) end. vcs_vsn(Config, Vcs, Dir) -> |