From 134a627130a732f6315d323895365dd59fab95c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C5=99emysl=20Janouch?=
Date: Sun, 3 May 2015 19:11:57 +0200
Subject: degesch: finish /set
One bug remaining to make it work.
---
common.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
(limited to 'common.c')
diff --git a/common.c b/common.c
index 629b31b..1ec8cee 100644
--- a/common.c
+++ b/common.c
@@ -1385,6 +1385,20 @@ end:
return object;
}
+/// Clone an item. Schema assignments aren't retained.
+struct config_item_ *
+config_item_clone (struct config_item_ *self)
+{
+ // Oh well, it saves code
+ struct str tmp;
+ str_init (&tmp);
+ config_item_write (self, false, &tmp);
+ struct config_item_ *result =
+ config_item_parse (tmp.str, tmp.len, true, NULL);
+ str_free (&tmp);
+ return result;
+}
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// XXX: this thing is ugly in concept
--
cgit v1.2.3