Fix handling of Unicode characters in env vars

This commit is contained in:
Slava Yurin 2013-02-15 09:00:46 +07:00
parent 78fa8fc3d5
commit fb77295a1f

View file

@ -195,7 +195,7 @@ expand_env_variable(InStr, VarName, RawVarValue) ->
%% 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}], ReOpts = [global, {return, list}, unicode],
re:replace(InStr, RegEx, [VarValue, "\\2"], ReOpts) re:replace(InStr, RegEx, [VarValue, "\\2"], ReOpts)
end. end.