From ee486f95dcd45fdd4acc5a1893f37e64310f8f15 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 6 Aug 2001 22:17:18 +0000 Subject: Don't strstr for noselect=yes, that's just plain broken. 2001-08-06 Jeffrey Stedfast * providers/imap/camel-imap-store.c (get_folder_info_online): Don't strstr for noselect=yes, that's just plain broken. svn path=/trunk/; revision=11714 --- camel/providers/pop3/camel-pop3-folder.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'camel/providers/pop3/camel-pop3-folder.c') diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c index b33a9f1569..0032077fd6 100644 --- a/camel/providers/pop3/camel-pop3-folder.c +++ b/camel/providers/pop3/camel-pop3-folder.c @@ -285,16 +285,16 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex) char *result, *body; CamelStream *msgstream; CamelMimeMessage *msg; - + num = uid_to_number (CAMEL_POP3_FOLDER (folder), uid); if (num == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, _("No message with uid %s"), uid); return NULL; } - - camel_operation_start_transient(NULL, _("Retrieving POP message %d"), num); - + + camel_operation_start_transient (NULL, _("Retrieving POP message %d"), num); + status = camel_pop3_command (CAMEL_POP3_STORE (folder->parent_store), &result, ex, "RETR %d", num); switch (status) { @@ -304,14 +304,13 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex) g_free (result); /* fall through */ case CAMEL_POP3_FAIL: - camel_operation_end(NULL); + camel_operation_end (NULL); return NULL; } - - /* this should be "nnn octets" ? No. RTFRFC. FIXME. */ + if (result && sscanf (result, "%d", &total) != 1) total = 0; - + g_free (result); body = camel_pop3_command_get_additional_data (CAMEL_POP3_STORE (folder->parent_store), total, ex); if (!body) { @@ -320,21 +319,21 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex) _("Could not retrieve message from POP " "server %s: %s"), service->url->host, camel_exception_get_description (ex)); - camel_operation_end(NULL); + camel_operation_end (NULL); return NULL; } - + msgstream = camel_stream_mem_new_with_buffer (body, strlen (body)); g_free (body); msg = camel_mime_message_new (); camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (msg), CAMEL_STREAM (msgstream)); - + camel_object_unref (CAMEL_OBJECT (msgstream)); - - camel_operation_end(NULL); - + + camel_operation_end (NULL); + return msg; } -- cgit v1.2.3