aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorMarcus Arendt <[email protected]>2014-12-29 10:13:57 +0100
committerMarcus Arendt <[email protected]>2014-12-29 10:13:57 +0100
commit4f7edc376ee61238699f68c8721ab23ee56eafee (patch)
tree1f403607afa54044cd2a64c6e545ee564e765b8c /lib/stdlib
parentbbf2555c6b8112407674c766f7884940669cf069 (diff)
parentf445c0008c389ff06741e5d5a18d6c75861598cf (diff)
downloadotp-4f7edc376ee61238699f68c8721ab23ee56eafee.tar.gz
otp-4f7edc376ee61238699f68c8721ab23ee56eafee.tar.bz2
otp-4f7edc376ee61238699f68c8721ab23ee56eafee.zip
Merge branch 'lemenkov/use_os_getenv_2'
* lemenkov/use_os_getenv_2: fix missing include Start using os:getenv/2 fun Introduce os:getenv/2
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) ->