diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-09-24 05:25:48 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-09-24 05:25:48 +0800 |
commit | 1b5c1357dcbf4cfcd450c33d76c51c2e14252cf8 (patch) | |
tree | c164cd3c68829b39d550a6a99caa1c33a1464d2f /mail/evolution-mbox-upgrade.c | |
parent | 020a8e0361c3641322a62b03912d8e29a06791ba (diff) | |
download | gsoc2013-evolution-1b5c1357dcbf4cfcd450c33d76c51c2e14252cf8.tar.gz gsoc2013-evolution-1b5c1357dcbf4cfcd450c33d76c51c2e14252cf8.tar.zst gsoc2013-evolution-1b5c1357dcbf4cfcd450c33d76c51c2e14252cf8.zip |
Don't xmlFree (name) until after we've g_strdup'd it. (em_migrate_dir): If
2003-09-23 Jeffrey Stedfast <fejj@ximian.com>
* 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
Diffstat (limited to 'mail/evolution-mbox-upgrade.c')
-rw-r--r-- | mail/evolution-mbox-upgrade.c | 26 |
1 files changed, 18 insertions, 8 deletions
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);*/ |