diff options
Diffstat (limited to 'camel/providers/imap')
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 6 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-folder.h | 2 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 10 |
3 files changed, 7 insertions, 11 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 539b906ba6..7d744d701d 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -185,10 +185,10 @@ camel_imap_folder_get_type (void) } CamelFolder * -camel_imap_folder_new (CamelStore *parent, char *folder_name) +camel_imap_folder_new (CamelStore *parent, const char *folder_name) { CamelFolder *folder = CAMEL_FOLDER (camel_object_new (camel_imap_folder_get_type ())); - char *dir_sep, *short_name; + const char *dir_sep, *short_name; dir_sep = CAMEL_IMAP_STORE (parent)->dir_sep; short_name = strrchr (folder_name, *dir_sep); @@ -571,7 +571,7 @@ imap_get_subfolder_info_internal (CamelFolder *folder, CamelException *ex) } } - if (!strcmp (folder->name, namespace) && !found_inbox) { + if (!*folder->name && !found_inbox) { fi = g_new0 (CamelFolderInfo, 1); fi->full_name = g_strdup ("INBOX"); fi->name = g_strdup ("INBOX"); diff --git a/camel/providers/imap/camel-imap-folder.h b/camel/providers/imap/camel-imap-folder.h index 3dc10b3682..2589ab4d50 100644 --- a/camel/providers/imap/camel-imap-folder.h +++ b/camel/providers/imap/camel-imap-folder.h @@ -62,7 +62,7 @@ typedef struct { /* public methods */ -CamelFolder *camel_imap_folder_new (CamelStore *parent, char *folder_name); +CamelFolder *camel_imap_folder_new (CamelStore *parent, const char *folder_name); void camel_imap_folder_changed (CamelFolder *folder, gint recent, GPtrArray *expunged, CamelException *ex); diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index a55de84dda..853059b618 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -389,16 +389,15 @@ get_folder (CamelStore *store, const char *folder_name, gboolean create, CamelEx gboolean exists = FALSE; gboolean selectable; - folder_path = camel_imap_store_folder_path (imap_store, folder_name); - new_folder = camel_imap_folder_new (store, folder_path); + new_folder = camel_imap_folder_new (store, folder_name); /* this is the top-level dir, we already know it exists - it has to! */ if (!*folder_name) { - g_free (folder_path); camel_folder_refresh_info (new_folder, ex); return new_folder; } + folder_path = camel_imap_store_folder_path (imap_store, folder_name); if (imap_folder_exists (imap_store, folder_path, &selectable, ex)) { exists = TRUE; if (!selectable) @@ -1034,13 +1033,10 @@ camel_imap_command_preliminary (CamelImapStore *store, char **cmdid, CamelExcept return CAMEL_IMAP_FAIL; /* Check for '+' which indicates server is ready for command continuation */ - if (*respbuf == '+') { - g_free (cmdid); + if (*respbuf == '+') return CAMEL_IMAP_PLUS; - } status = camel_imap_status (*cmdid, respbuf); - g_free (cmdid); if (respbuf) { /* get error response and set exception accordingly */ |