mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Merge pull request #102 from pragdave/master
Add one more "unicode" option in expand_env_variable—I have a bullet in my prompt that was blowing it up
This commit is contained in:
commit
be8b022a82
1 changed files with 2 additions and 2 deletions
|
@ -191,11 +191,11 @@ expand_env_variable(InStr, VarName, RawVarValue) ->
|
||||||
%% No variables to expand
|
%% No variables to expand
|
||||||
InStr;
|
InStr;
|
||||||
_ ->
|
_ ->
|
||||||
VarValue = re:replace(RawVarValue, "\\\\", "\\\\\\\\", [global]),
|
ReOpts = [global, unicode, {return, list}],
|
||||||
|
VarValue = re:replace(RawVarValue, "\\\\", "\\\\\\\\", ReOpts),
|
||||||
%% Use a regex to match/replace:
|
%% Use a regex to match/replace:
|
||||||
%% Given variable "FOO": match $FOO\s | $FOOeol | ${FOO}
|
%% Given variable "FOO": match $FOO\s | $FOOeol | ${FOO}
|
||||||
RegEx = io_lib:format("\\\$(~s(\\s|$)|{~s})", [VarName, VarName]),
|
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)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue