Re: [evolution-patches] Bugfix in the maildir code of Camel



On Tue, 2007-06-26 at 11:27 +0200, Philip Van Hoof wrote:
> I think rename will return either 0 or -1, not 1

And this one makes maildir work on VFAT too (MMC cards, for example)

-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog



Index: trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-summary.c
===================================================================
--- trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-summary.c	(revision 2269)
+++ trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-summary.c	(working copy)
@@ -190,8 +190,9 @@
 	int i;
 
 	uid = camel_message_info_uid (info);
-	buf = g_alloca (strlen (uid) + strlen (":2,") +  (sizeof (flagbits) / sizeof (flagbits[0])) + 1);
-	p = buf + sprintf (buf, "%s:2,", uid);
+	/* TNY CHANGE: This used to he ":2,", but VFAT does not allow those characters */
+	buf = g_alloca (strlen (uid) + strlen ("_2_") +  (sizeof (flagbits) / sizeof (flagbits[0])) + 1);
+	p = buf + sprintf (buf, "%s_2_", uid);
 	for (i = 0; i < sizeof (flagbits) / sizeof (flagbits[0]); i++) {
 		if (info->info.info.flags & flagbits[i].flagbit)
 			*p++ = flagbits[i].flag;
Index: trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-folder.c
===================================================================
--- trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-folder.c	(revision 2269)
+++ trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-folder.c	(working copy)
@@ -190,7 +190,7 @@
 	
 	/* now move from tmp to cur (bypass new, does it matter?) */
 	dest = g_strdup_printf("%s/cur/%s", lf->folder_path, camel_maildir_info_filename (mdi));
-	if (rename (name, dest) == 1)
+	if (rename (name, dest) == -1)
 		goto fail_write;
 
 	g_free (dest);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]