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:
Dave Thomas 2013-06-21 23:40:32 -05:00
parent 271299a4e9
commit 934ec7fdef

View file

@ -191,7 +191,7 @@ expand_env_variable(InStr, VarName, RawVarValue) ->
%% No variables to expand
InStr;
_ ->
VarValue = re:replace(RawVarValue, "\\\\", "\\\\\\\\", [global]),
VarValue = re:replace(RawVarValue, "\\\\", "\\\\\\\\", [global, unicode]),
%% Use a regex to match/replace:
%% Given variable "FOO": match $FOO\s | $FOOeol | ${FOO}
RegEx = io_lib:format("\\\$(~s(\\s|$)|{~s})", [VarName, VarName]),