aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-url.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-url.c')
-rw-r--r--camel/camel-url.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/camel/camel-url.c b/camel/camel-url.c
index 7b1c31db5c..78a5beec44 100644
--- a/camel/camel-url.c
+++ b/camel/camel-url.c
@@ -560,3 +560,25 @@ camel_url_equal(const void *v, const void *v2)
&& check_equal(u1->query, u2->query)
&& u1->port == u2->port;
}
+
+CamelURL *
+camel_url_copy(const CamelURL *in)
+{
+ CamelURL *out;
+
+ out = g_malloc(sizeof(*out));
+ out->protocol = g_strdup(in->protocol);
+ out->user = g_strdup(in->user);
+ out->authmech = g_strdup(in->authmech);
+ out->passwd = g_strdup(in->passwd);
+ out->host = g_strdup(in->host);
+ out->port = in->port;
+ out->path = g_strdup(in->path);
+ out->params = NULL;
+ if (in->params)
+ g_datalist_foreach(&((CamelURL *)in)->params, copy_param, &out->params);
+ out->query = g_strdup(in->query);
+ out->fragment = g_strdup(in->fragment);
+
+ return out;
+}