Permalink
Browse files

Fix crsh with Unicode in environment vars

  • Loading branch information...
1 parent dd277fd commit 091405bce7a59769a86fcbf8e44602c05b7082a1 @pragdave pragdave committed Jun 24, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/rebar_utils.erl
View
@@ -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) ->

0 comments on commit 091405b

Please sign in to comment.