Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [bug] gdbm tied hashes always consider members set



On Sun, Jul 25, 2021 at 10:07 AM Stephane Chazelas
<stephane@xxxxxxxxxxxx> wrote:
>
> Members are always consider set even when they're not.

It seems to be this easy:

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 */




Messages sorted by: Reverse Date, Date, Thread, Author