about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@ipost.com>2021-09-06 13:27:01 -0700
committerBart Schaefer <schaefer@ipost.com>2021-09-06 13:27:01 -0700
commit7000b04e766376890e597ffe7d6cf26c444fce53 (patch)
tree42b345fdf7121b9b84b0e7c35cdba831a9868994
parentca2e71e0eba4852bd91c620bf72b00198f309f12 (diff)
downloadzsh-7000b04e766376890e597ffe7d6cf26c444fce53.tar.gz
zsh-7000b04e766376890e597ffe7d6cf26c444fce53.tar.xz
zsh-7000b04e766376890e597ffe7d6cf26c444fce53.zip
49196: gdbm keys not present in the database appear unset in tied hashes
-rw-r--r--ChangeLog3
-rw-r--r--Src/Modules/db_gdbm.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 58822495e..31beb268e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2021-09-06  Bart Schaefer  <schaefer@zsh.org>
 
+	* 49196: Src/Modules/db_gdbm.c: gdbm keys not present in the
+	database appear unset in tied hashes
+
 	* Marlon Richert: 48969: fix for "zle -N" completion
 
 	* 48888: Doc/Zsh/mod_system.yo, Doc/Zsh/params.yo, Test/E03posix.ztst:
diff --git a/Src/Modules/db_gdbm.c b/Src/Modules/db_gdbm.c
index b8e7c76c6..84fdfa905 100644
--- a/Src/Modules/db_gdbm.c
+++ b/Src/Modules/db_gdbm.c
@@ -332,6 +332,8 @@ gdbmgetfn(Param pm)
 
         /* Can return pointer, correctly saved inside hash */
         return pm->u.str;
+    } else {
+      pm->node.flags |= PM_DEFAULTED;
     }
 
     /* Free key */