Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix crash when env vars contain utf8 chars

  • Loading branch information...
commit dd277fd01ac6da0661df878a123db93cd09f040e 1 parent 934ec7f
@pragdave pragdave authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/rebar_utils.erl
View
6 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) ->
Please sign in to comment.
Something went wrong with that request. Please try again.