aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/dets.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-01-11 12:59:33 +0100
committerHans Bolinder <[email protected]>2016-01-13 09:57:15 +0100
commitf31ae20fbb2af0eeb9c87cfa1243abafbe7773cd (patch)
treee4e8f3dfbb67645ae510448b1b21106cb897312f /lib/stdlib/src/dets.erl
parentd230f885454acbc1492f42d0f190b9d5c8eb98ec (diff)
downloadotp-f31ae20fbb2af0eeb9c87cfa1243abafbe7773cd.tar.gz
otp-f31ae20fbb2af0eeb9c87cfa1243abafbe7773cd.tar.bz2
otp-f31ae20fbb2af0eeb9c87cfa1243abafbe7773cd.zip
stdlib: Let dets:open_file() crash when given raw file name
See also ERL-55.
Diffstat (limited to 'lib/stdlib/src/dets.erl')
-rw-r--r--lib/stdlib/src/dets.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/stdlib/src/dets.erl b/lib/stdlib/src/dets.erl
index 6d07f4018a..7036316242 100644
--- a/lib/stdlib/src/dets.erl
+++ b/lib/stdlib/src/dets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1124,7 +1124,9 @@ repl({delayed_write, {Delay,Size} = C}, Defs)
Defs#open_args{delayed_write = C};
repl({estimated_no_objects, I}, Defs) ->
repl({min_no_slots, I}, Defs);
-repl({file, File}, Defs) ->
+repl({file, File}, Defs) when is_list(File) ->
+ Defs#open_args{file = File};
+repl({file, File}, Defs) when is_atom(File) ->
Defs#open_args{file = to_list(File)};
repl({keypos, P}, Defs) when is_integer(P), P > 0 ->
Defs#open_args{keypos =P};