dovecot-2.0-sslstream: dsync: dsync_mailbox_dup() wasn't duping ...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 02:56:28 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/062fe605cd19
changeset: 10344:062fe605cd19
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 17 14:28:25 2009 -0500
description:
dsync: dsync_mailbox_dup() wasn't duping cache fields.

diffstat:

1 file changed, 13 insertions(+), 1 deletion(-)
src/dsync/dsync-data.c |   14 +++++++++++++-

diffs (35 lines):

diff -r 6431c35a9670 -r 062fe605cd19 src/dsync/dsync-data.c
--- a/src/dsync/dsync-data.c	Tue Nov 17 14:01:33 2009 -0500
+++ b/src/dsync/dsync-data.c	Tue Nov 17 14:28:25 2009 -0500
@@ -1,7 +1,7 @@
 /* Copyright (c) 2009 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "buffer.h"
+#include "array.h"
 #include "hex-binary.h"
 #include "sha1.h"
 #include "dsync-data.h"
@@ -10,10 +10,22 @@ dsync_mailbox_dup(pool_t pool, const str
 dsync_mailbox_dup(pool_t pool, const struct dsync_mailbox *box)
 {
 	struct dsync_mailbox *dest;
+	const char *const *cache_fields = NULL, *dup;
+	unsigned int i, count = 0;
 
 	dest = p_new(pool, struct dsync_mailbox, 1);
 	*dest = *box;
 	dest->name = p_strdup(pool, box->name);
+
+	if (array_is_created(&box->cache_fields))
+		cache_fields = array_get(&box->cache_fields, &count);
+	if (count > 0) {
+		p_array_init(&dest->cache_fields, pool, count);
+		for (i = 0; i < count; i++) {
+			dup = p_strdup(pool, cache_fields[i]);
+			array_append(&dest->cache_fields, &dup, 1);
+		}
+	}
 	return dest;
 }
 


More information about the dovecot-cvs mailing list