aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorPeter Lemenkov <[email protected]>2014-12-02 13:31:37 +0300
committerPeter Lemenkov <[email protected]>2014-12-15 21:05:05 +0300
commitbb7fb3c31d1939ab39fb14322d11a59bc34d8f42 (patch)
treeb3a37d800ac7d073723cd5cc02da09839e2b79e8 /lib/stdlib
parent5cbad390e971ff92a7fb1b71757041ff9edeb81a (diff)
downloadotp-bb7fb3c31d1939ab39fb14322d11a59bc34d8f42.tar.gz
otp-bb7fb3c31d1939ab39fb14322d11a59bc34d8f42.tar.bz2
otp-bb7fb3c31d1939ab39fb14322d11a59bc34d8f42.zip
Start using os:getenv/2 fun
See #535 Signed-off-by: Peter Lemenkov <[email protected]>
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/src/win32reg.erl7
-rw-r--r--lib/stdlib/test/io_proto_SUITE.erl7
2 files changed, 2 insertions, 12 deletions
diff --git a/lib/stdlib/src/win32reg.erl b/lib/stdlib/src/win32reg.erl
index 48a7e262be..38c41a5f6e 100644
--- a/lib/stdlib/src/win32reg.erl
+++ b/lib/stdlib/src/win32reg.erl
@@ -218,12 +218,7 @@ expand([C|Rest], [], Result) ->
expand(Rest, [], [C|Result]);
expand([$%|Rest], Env0, Result) ->
Env = lists:reverse(Env0),
- case os:getenv(Env) of
- false ->
- expand(Rest, [], Result);
- Value ->
- expand(Rest, [], lists:reverse(Value)++Result)
- end;
+ expand(Rest, [], lists:reverse(os:getenv(Env, ""))++Result);
expand([C|Rest], Env, Result) ->
expand(Rest, [C|Env], Result);
expand([], [], Result) ->
diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl
index 76a8109a8d..c55836ff87 100644
--- a/lib/stdlib/test/io_proto_SUITE.erl
+++ b/lib/stdlib/test/io_proto_SUITE.erl
@@ -69,12 +69,7 @@
init_per_testcase(_Case, Config) ->
?line Dog = ?t:timetrap(?default_timeout),
- Term = case os:getenv("TERM") of
- List when is_list(List) ->
- List;
- _ ->
- "dumb"
- end,
+ Term = os:getenv("TERM", "dumb"),
os:putenv("TERM","vt100"),
[{watchdog, Dog}, {term, Term} | Config].
end_per_testcase(_Case, Config) ->