[dovecot-cvs] dovecot/src/plugins/lazy-expunge lazy-expunge-plugin.c, 1.1.2.2, 1.1.2.3
tss at dovecot.org
tss at dovecot.org
Fri Jan 5 14:22:32 UTC 2007
Update of /var/lib/cvs/dovecot/src/plugins/lazy-expunge
In directory talvi:/tmp/cvs-serv8872
Modified Files:
Tag: branch_1_0
lazy-expunge-plugin.c
Log Message:
If index/control dirs were different than the maildir, deleting mailboxes
didn't move their contents correctly.
Index: lazy-expunge-plugin.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/lazy-expunge/lazy-expunge-plugin.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- lazy-expunge-plugin.c 17 Dec 2006 14:32:09 -0000 1.1.2.2
+++ lazy-expunge-plugin.c 5 Jan 2007 14:22:30 -0000 1.1.2.3
@@ -303,10 +303,17 @@
str_append(src_path, srcdir);
str_append(dest_path, destdir);
+ str_append_c(src_path, '/');
+ str_append_c(dest_path, '/');
src_dirlen = str_len(src_path);
dest_dirlen = str_len(dest_path);
while ((dp = readdir(dir)) != NULL) {
+ if (dp->d_name[0] == '.' &&
+ (dp->d_name[1] == '\0' ||
+ (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
+ continue;
+
str_truncate(src_path, src_dirlen);
str_append(src_path, dp->d_name);
str_truncate(dest_path, dest_dirlen);
@@ -373,7 +380,7 @@
if (strcmp(src2dir, srcdir) != 0) {
destdir = mail_storage_get_mailbox_control_dir(dest_storage,
dest_name);
- (void)dir_move_or_merge(src_storage, srcdir, destdir);
+ (void)dir_move_or_merge(src_storage, src2dir, destdir);
}
src3dir = t_strconcat(src_istorage->index_dir, "/"MAILDIR_FS_SEP_S,
src_name, NULL);
@@ -381,7 +388,7 @@
destdir = t_strconcat(dest_istorage->index_dir,
"/"MAILDIR_FS_SEP_S,
dest_name, NULL);
- (void)dir_move_or_merge(src_storage, srcdir, destdir);
+ (void)dir_move_or_merge(src_storage, src3dir, destdir);
}
t_pop();
More information about the dovecot-cvs
mailing list