summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-07-14 20:48:17 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-07-14 21:16:35 +0200
commit955552f4fac26c936d1c2951ee0f8fd214b401ef (patch)
tree316cd2e02c64914d777429f92512bb2b5a26664b /common.c
parent0c5591fed26bb0613083f45036ac590bdf4ee8dd (diff)
downloadxK-955552f4fac26c936d1c2951ee0f8fd214b401ef.tar.gz
xK-955552f4fac26c936d1c2951ee0f8fd214b401ef.tar.xz
xK-955552f4fac26c936d1c2951ee0f8fd214b401ef.zip
degesch: implement /server rename
Diffstat (limited to 'common.c')
-rw-r--r--common.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/common.c b/common.c
index 423bb7e..afca7e1 100644
--- a/common.c
+++ b/common.c
@@ -70,6 +70,17 @@ str_vector_find (const struct str_vector *v, const char *s)
return -1;
}
+static void *
+str_map_steal (struct str_map *self, const char *key)
+{
+ void *value = str_map_find (self, key);
+ void (*free_backup) (void *) = self->free;
+ self->free = NULL;
+ str_map_set (self, key, NULL);
+ self->free = free_backup;
+ return value;
+}
+
// --- Logging -----------------------------------------------------------------
static void