diff options
author | Clint Adams <clint@users.sourceforge.net> | 2008-07-21 02:24:03 +0000 |
---|---|---|
committer | Clint Adams <clint@users.sourceforge.net> | 2008-07-21 02:24:03 +0000 |
commit | 8954f31c7c33351deff85e0f419bb6abb2c4ca54 (patch) | |
tree | f1203b4ab84cf35dab99fb61195e773e0375caf3 | |
parent | fdf44493380feb99f8cbb5222df648f23bdcb731 (diff) | |
download | zsh-8954f31c7c33351deff85e0f419bb6abb2c4ca54.tar.gz zsh-8954f31c7c33351deff85e0f419bb6abb2c4ca54.tar.xz zsh-8954f31c7c33351deff85e0f419bb6abb2c4ca54.zip |
25321: delete gdbm node when corresponding hash entry is unset.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Src/Modules/db_gdbm.c | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 8c79cd02e..859082dc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-21 Clint Adams <clint@zsh.org> + * 25321: Src/Modules/db_gdbm.c: delete gdbm node when + corresponding hash entry is unset. + * 25320: Src/Modules/db_gdbm.c: fix read and write of elements by key. diff --git a/Src/Modules/db_gdbm.c b/Src/Modules/db_gdbm.c index d8f6724ea..ce7a6f57e 100644 --- a/Src/Modules/db_gdbm.c +++ b/Src/Modules/db_gdbm.c @@ -132,7 +132,6 @@ gdbmsetfn(Param pm, char **val) datum key, content; int ret; - key.dptr = pm->node.nam; key.dsize = strlen(key.dptr) + 1; content.dptr = val; @@ -145,7 +144,13 @@ gdbmsetfn(Param pm, char **val) static void gdbmunsetfn(Param pm, int um) { + datum key; + int ret; + + key.dptr = pm->node.nam; + key.dsize = strlen(key.dptr) + 1; + ret = gdbm_delete(dbf, key); } /**/ |