Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: unset/delete gdbm elements
- X-seq: zsh-workers 25321
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: unset/delete gdbm elements
- Date: Mon, 21 Jul 2008 02:21:45 +0000
- In-reply-to: <20080721014412.GA23562@xxxxxxxx>
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080721001634.GA20601@xxxxxxxx> <20080721005152.GA21796@xxxxxxxx> <20080721014412.GA23562@xxxxxxxx>
ztie -d db/gdbm -f /tmp/newfile.db hokeypokey
hokeypokey[horse]=buggy
hokeypokey[apple]=pie
print -l -- ${hokeypokey}
print ${hokeypokey[horse]}
print ${hokeypokey[apple]}
unset "hokeypokey[apple]"
diff --git a/Src/Modules/db_gdbm.c b/Src/Modules/db_gdbm.c
index d8f6724..ce7a6f5 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);
}
/**/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author