dovecot: Handle RENAME "a" "a.b" correctly. Based on patch by pod.

dovecot at dovecot.org dovecot at dovecot.org
Sun Oct 21 02:20:31 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/d7ed8c41d8b3
changeset: 6578:d7ed8c41d8b3
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Oct 21 02:20:23 2007 +0300
description:
Handle RENAME "a" "a.b" correctly. Based on patch by pod.

diffstat:

1 file changed, 7 insertions(+)
src/lib-storage/list/mailbox-list-maildir.c |    7 +++++++

diffs (17 lines):

diff -r 5b2ff32877d4 -r d7ed8c41d8b3 src/lib-storage/list/mailbox-list-maildir.c
--- a/src/lib-storage/list/mailbox-list-maildir.c	Sun Oct 21 01:43:48 2007 +0300
+++ b/src/lib-storage/list/mailbox-list-maildir.c	Sun Oct 21 02:20:23 2007 +0300
@@ -342,6 +342,13 @@ static int rename_children(struct mailbo
 		t_push();
 
 		old_listname = t_strconcat(oldname, names[i], NULL);
+		if (strcmp(old_listname, newname) == 0) {
+			/* When doing RENAME "a" "a.b" we see "a.b" here.
+			   We don't want to rename it anymore to "a.b.b". */
+			t_pop();
+			continue;
+		}
+
 		new_listname = t_strconcat(newname, names[i], NULL);
 		oldpath = mailbox_list_get_path(list, old_listname,
 						MAILBOX_LIST_PATH_TYPE_MAILBOX);


More information about the dovecot-cvs mailing list