Re: [PATCH] cachefile-fat32-comptatible



Hi,

I forgot to put a NULL at a g_build_filename argument.

Also, I think we must ignore cache files that don't end by a '.' or by
".~". 
Because the cache_put function provokes glib-Critical and may seg
fault if key and uid are the same.

Of course with my last patch, new cache files will always end by '.', by
".~" or by ".xxx".

I attached a patch.

Regards,

* Philip Van Hoof <spam pvanhoof be> [2008-11-13 17:44:54 +0100]:
> Patch accepted and committed
> 
> Thanks!
> 
> On Thu, 2008-11-13 at 16:51 +0100, Thomas Guillem wrote:
> > OK, new patch attached.
> > 
> > * Philip Van Hoof <spam pvanhoof be> [2008-11-13 15:50:56 +0100]:
> > > I know that the existing code didn't do this either, but please use
> > > g_build_filename instead of hardcoding the directory separator as '/'
> > > for new code and patches.
> > > 
> > > On Thu, 2008-11-13 at 15:25 +0100, Thomas Guillem wrote:
> > > > Hi,
> > > > 
> > > > The attached patch change cache filename in order to be compatible with
> > > > FAT32 Partions, like we discussed on IRC.
> > > > 
> > > > Is it OK ?
> > > > 
> 
> -- 
> Philip Van Hoof, freelance software developer
> home: me at pvanhoof dot be 
> gnome: pvanhoof at gnome dot org 
> http://pvanhoof.be/blog
> http://codeminded.be
> 

-- 
Thomas Guillem - http://tomoueb.com
Etudiant en GI03 (Génie Informatique) à l'UTBM (http://www.utbm.fr)
Index: libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c
===================================================================
--- libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c	(revision 54905)
+++ libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c	(working copy)
@@ -189,9 +189,10 @@
 			uid = g_strndup (dname, p - dname);
 		else if ((p = strchr (dname, '_')))
 			uid = g_strndup (dname, p - dname);
-		else
-			uid = g_strdup (dname);
-
+		else {
+			g_warning("Cache file name Invalid\n");
+			continue;
+		}
 		info = camel_folder_summary_uid (summary, uid);
 		if (info) {
 			camel_message_info_free(info);
@@ -346,7 +347,7 @@
 {
 	gchar *file;
 	if (part_spec && *part_spec) {
-		file = g_build_filename(path, uid, part_spec);
+		file = g_build_filename(path, uid, part_spec, NULL);
 	} else {
 		char tmp [512];
 

Attachment: pgpZqZJZEZQng.pgp
Description: PGP signature



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