aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Larsson <lukas@erlang-solutions.com>2012-06-01 11:06:09 +0200
committerLukas Larsson <lukas@erlang-solutions.com>2012-06-01 11:06:09 +0200
commitbfe9bf0007b5babb6b72cf7bc2a23e7f5c131232 (patch)
treef1f99c57b1d10c42c8024108d1cb6729df329cd1 /lib
parentb82c337dfce2d5bc1e435ebaa6060cb982bc5ad6 (diff)
parentf95a54ece96090c0b918d30205d13bcd4a015786 (diff)
downloadotp-bfe9bf0007b5babb6b72cf7bc2a23e7f5c131232.tar.gz
otp-bfe9bf0007b5babb6b72cf7bc2a23e7f5c131232.tar.bz2
otp-bfe9bf0007b5babb6b72cf7bc2a23e7f5c131232.zip
Merge branch 'lukas/stdlib/ensure_dir_infinite_loop/OTP-10104' into maint
* lukas/stdlib/ensure_dir_infinite_loop/OTP-10104: Fix infinite loop when an invalid drive letter it given
Diffstat (limited to 'lib')
-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