From 1b5c1357dcbf4cfcd450c33d76c51c2e14252cf8 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 23 Sep 2003 21:25:48 +0000 Subject: Don't xmlFree (name) until after we've g_strdup'd it. (em_migrate_dir): If 2003-09-23 Jeffrey Stedfast * evolution-mbox-upgrade.c (get_local_store): Don't xmlFree (name) until after we've g_strdup'd it. (em_migrate_dir): If the metadata file doesn't exist, don't even bother trying subfolers (the shell just ignores them so we should too). svn path=/trunk/; revision=22679 --- mail/ChangeLog | 5 +++++ mail/evolution-mbox-upgrade.c | 26 ++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 11c7519767..97dc2f416d 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -2,6 +2,11 @@ * evolution-mbox-upgrade.c (get_local_store): Don't xmlFree (name) until after we've g_strdup'd it. + (em_migrate_dir): If the metadata file doesn't exist, don't even + bother trying subfolers (the shell just ignores them so we should + too). + +2003-09-23 Jeffrey Stedfast Fix for bug #48791 (and also fixes a FIXME) diff --git a/mail/evolution-mbox-upgrade.c b/mail/evolution-mbox-upgrade.c index 92a2844034..8d8c76cdc8 100644 --- a/mail/evolution-mbox-upgrade.c +++ b/mail/evolution-mbox-upgrade.c @@ -102,14 +102,10 @@ em_migrate_session_new (const char *path) static gboolean is_mail_folder (const char *metadata) { - struct stat st; xmlNodePtr node; xmlDocPtr doc; char *type; - if (stat (metadata, &st) == -1 || !S_ISREG (st.st_mode)) - return FALSE; - if (!(doc = xmlParseFile (metadata))) { g_warning ("Cannot parse `%s'", metadata); return FALSE; @@ -229,8 +225,14 @@ em_migrate_dir (EMMigrateSession *session, const char *dirname, const char *full DIR *dir; path = g_strdup_printf ("%s/folder-metadata.xml", dirname); + if (stat (path, &st) == -1 || !S_ISREG (st.st_mode)) { + g_free (path); + return; + } + if (!is_mail_folder (path)) { g_free (path); + goto try_subdirs; } @@ -244,7 +246,9 @@ em_migrate_dir (EMMigrateSession *session, const char *dirname, const char *full g_warning ("error opening old store for `%s': %s", full_name, ex.desc); camel_exception_clear (&ex); g_free (path); - return; + + /* try subfolders anyway? */ + goto try_subdirs; } g_free (path); @@ -254,7 +258,9 @@ em_migrate_dir (EMMigrateSession *session, const char *dirname, const char *full camel_object_unref (local_store); camel_exception_clear (&ex); g_free (name); - return; + + /* try subfolders anyway? */ + goto try_subdirs; } g_free (name); @@ -265,7 +271,9 @@ em_migrate_dir (EMMigrateSession *session, const char *dirname, const char *full camel_object_unref (local_store); camel_object_unref (old_folder); camel_exception_clear (&ex); - return; + + /* try subfolders anyway? */ + goto try_subdirs; } uids = camel_folder_get_uids (old_folder); @@ -278,7 +286,9 @@ em_migrate_dir (EMMigrateSession *session, const char *dirname, const char *full camel_object_unref (old_folder); camel_object_unref (new_folder); camel_exception_clear (&ex); - return; + + /* try subfolders anyway? */ + goto try_subdirs; } /*camel_object_unref (local_store);*/ -- cgit v1.2.3