aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/dets_v8.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2010-11-04 15:20:23 +0100
committerHans Bolinder <[email protected]>2010-11-04 15:20:23 +0100
commit1d3edd9e902269d956d38e883127c9c7527f419d (patch)
tree25dd2d511f28174e89006024a5babda9bcdce1b0 /lib/stdlib/src/dets_v8.erl
parentf8ac585a7ba8b2d35bc24c6d7c2fa5d5df1e2f6e (diff)
downloadotp-1d3edd9e902269d956d38e883127c9c7527f419d.tar.gz
otp-1d3edd9e902269d956d38e883127c9c7527f419d.tar.bz2
otp-1d3edd9e902269d956d38e883127c9c7527f419d.zip
Fix badly formed Dets file after initialization
If a Dets table with fewer slots than keys was opened and then closed after just a lookup, the contents were no longer well-formed. This bug has been fixed. (Thanks to Matthew Evans.)
Diffstat (limited to 'lib/stdlib/src/dets_v8.erl')
-rw-r--r--lib/stdlib/src/dets_v8.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/stdlib/src/dets_v8.erl b/lib/stdlib/src/dets_v8.erl
index 1f9f84cd27..af36958c1c 100644
--- a/lib/stdlib/src/dets_v8.erl
+++ b/lib/stdlib/src/dets_v8.erl
@@ -1074,6 +1074,8 @@ wl([], _Type, Del, Lookup, I, Objs) ->
[{Del, Lookup, Objs} | I].
%% -> {NewHead, ok} | {NewHead, Error}
+may_grow(Head, 0, once) ->
+ {Head, ok};
may_grow(Head, _N, _How) when Head#head.fixed =/= false ->
{Head, ok};
may_grow(#head{access = read}=Head, _N, _How) ->