From 955552f4fac26c936d1c2951ee0f8fd214b401ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Tue, 14 Jul 2015 20:48:17 +0200 Subject: degesch: implement /server rename --- common.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common.c') 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 -- cgit v1.2.3