[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-storage.c,1.31,1.32

cras at procontrol.fi cras at procontrol.fi
Sun Feb 23 23:14:53 EET 2003


Update of /home/cvs/dovecot/src/lib-storage/index/maildir
In directory danu:/tmp/cvs-serv18940/lib-storage/index/maildir

Modified Files:
	maildir-storage.c 
Log Message:
in-memory index crashfixes



Index: maildir-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/maildir/maildir-storage.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- maildir-storage.c	23 Feb 2003 21:06:57 -0000	1.31
+++ maildir-storage.c	23 Feb 2003 21:14:50 -0000	1.32
@@ -170,6 +170,9 @@
 {
 	const char *dir;
 
+	if (storage->index_dir == NULL)
+		return TRUE;
+
 	if (strcmp(storage->index_dir, storage->dir) == 0)
 		return TRUE;
 
@@ -338,8 +341,8 @@
 		return FALSE;
 	}
 
-	if (strcmp(storage->index_dir, storage->dir) != 0 &&
-	    *name != '/' && *name != '~') {
+	if (storage->index_dir != NULL && *name != '/' && *name != '~' &&
+	    strcmp(storage->index_dir, storage->dir) != 0) {
 		index_dir = t_strconcat(storage->index_dir, "/.", name, NULL);
 		if (unlink_directory(index_dir, TRUE) < 0) {
 			mail_storage_set_critical(storage,
@@ -382,7 +385,8 @@
 {
 	const char *oldpath, *newpath;
 
-	if (strcmp(storage->index_dir, storage->dir) == 0)
+	if (storage->index_dir == NULL ||
+	    strcmp(storage->index_dir, storage->dir) == 0)
 		return TRUE;
 
 	/* Rename it's index. */




More information about the dovecot-cvs mailing list