aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/filelib.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2012-05-23 10:13:44 +0200
committerLukas Larsson <[email protected]>2012-05-23 10:17:16 +0200
commitf95a54ece96090c0b918d30205d13bcd4a015786 (patch)
tree50586ddb6b7f73b47960365dd8d046a90935c3e3 /lib/stdlib/src/filelib.erl
parente4717301b73f2d7b2716b625e1b647b35d2815be (diff)
downloadotp-f95a54ece96090c0b918d30205d13bcd4a015786.tar.gz
otp-f95a54ece96090c0b918d30205d13bcd4a015786.tar.bz2
otp-f95a54ece96090c0b918d30205d13bcd4a015786.zip
Fix infinite loop when an invalid drive letter it given
Diffstat (limited to 'lib/stdlib/src/filelib.erl')
-rw-r--r--lib/stdlib/src/filelib.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/stdlib/src/filelib.erl b/lib/stdlib/src/filelib.erl
index d532cea187..b098d4cb91 100644
--- a/lib/stdlib/src/filelib.erl
+++ b/lib/stdlib/src/filelib.erl
@@ -264,6 +264,9 @@ ensure_dir(F) ->
case do_is_dir(Dir, file) of
true ->
ok;
+ false when Dir =:= F ->
+ %% Protect against infinite loop
+ {error,einval};
false ->
ensure_dir(Dir),
case file:make_dir(Dir) of