aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/Makefile.am3
-rw-r--r--camel/providers/imap/camel-imap-folder.c9
-rw-r--r--camel/providers/imap/camel-imap-search.c36
-rw-r--r--camel/providers/imap/camel-imap-utils.c29
4 files changed, 38 insertions, 39 deletions
diff --git a/camel/providers/imap/Makefile.am b/camel/providers/imap/Makefile.am
index 469964a9a6..b2f6014349 100644
--- a/camel/providers/imap/Makefile.am
+++ b/camel/providers/imap/Makefile.am
@@ -15,7 +15,8 @@ INCLUDES = -I.. \
$(CAMEL_CFLAGS) \
$(GNOME_INCLUDEDIR) \
$(GTK_INCLUDEDIR) \
- -DG_LOG_DOMAIN=\"camel-imap-provider\"
+ -DG_LOG_DOMAIN=\"camel-imap-provider\" \
+ -DG_DISABLE_DEPRECATED
libcamelimap_la_SOURCES = \
camel-imap-command.c \
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index e95904027a..e63dc73726 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -23,6 +23,7 @@
* USA
*/
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -689,7 +690,7 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, char **set)
if (range != -1) {
if (range != i - 1) {
info = matches->pdata[matches->len - 1];
- g_string_sprintfa (gset, ":%s", camel_message_info_uid (info));
+ g_string_append_printf (gset, ":%s", camel_message_info_uid (info));
}
range = -1;
}
@@ -702,12 +703,12 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, char **set)
range = i;
if (gset->len)
g_string_append_c (gset, ',');
- g_string_sprintfa (gset, "%s", camel_message_info_uid (info));
+ g_string_append_printf (gset, "%s", camel_message_info_uid (info));
}
if (range != -1 && range != max - 1) {
info = matches->pdata[matches->len - 1];
- g_string_sprintfa (gset, ":%s", camel_message_info_uid (info));
+ g_string_append_printf (gset, ":%s", camel_message_info_uid (info));
}
if (matches->len) {
@@ -1720,7 +1721,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
/* we assume that part->content_type is more accurate/full than ci->type */
camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (body_mp), part->content_type);
- spec = alloca (strlen (part_spec) + 6);
+ spec = g_alloca (strlen (part_spec) + 6);
sprintf (spec, part_spec[0] ? "%s.TEXT" : "TEXT", part_spec);
g_free (part_spec);
diff --git a/camel/providers/imap/camel-imap-search.c b/camel/providers/imap/camel-imap-search.c
index c30fa5611e..9fd59b2cd7 100644
--- a/camel/providers/imap/camel-imap-search.c
+++ b/camel/providers/imap/camel-imap-search.c
@@ -312,35 +312,35 @@ sync_match(CamelImapSearch *is, struct _match_record *mr)
struct _camel_search_words *words;
GString *search;
int i;
-
+
if (mr->lastuid >= is->lastuid && mr->validity == is->validity)
return 0;
-
- d(printf("updating match record for uid's %d:%d\n", mr->lastuid+1, is->lastuid));
-
+
+ d(printf ("updating match record for uid's %d:%d\n", mr->lastuid+1, is->lastuid));
+
/* TODO: Handle multiple search terms */
-
+
/* This handles multiple search words within a single term */
- words = camel_search_words_split(mr->terms[0]);
- search = g_string_new("");
- g_string_sprintfa(search, "UID %d:%d", mr->lastuid+1, is->lastuid);
- for (i=0;i<words->len;i++) {
+ words = camel_search_words_split (mr->terms[0]);
+ search = g_string_new ("");
+ g_string_append_printf (search, "UID %d:%d", mr->lastuid + 1, is->lastuid);
+ for (i = 0; i < words->len; i++) {
char *w = words->words[i]->word, c;
-
- g_string_sprintfa(search, " BODY \"");
+
+ g_string_append_printf (search, " BODY \"");
while ((c = *w++)) {
if (c == '\\' || c == '"')
- g_string_append_c(search, '\\');
- g_string_append_c(search, c);
+ g_string_append_c (search, '\\');
+ g_string_append_c (search, c);
}
- g_string_append_c(search, '"');
+ g_string_append_c (search, '"');
}
- camel_search_words_free(words);
-
+ camel_search_words_free (words);
+
/* We only try search using utf8 if its non us-ascii text? */
if ((words->type & CAMEL_SEARCH_WORD_8BIT) && (store->capabilities & IMAP_CAPABILITY_utf8_search)) {
- response = camel_imap_command(store, folder, NULL,
- "UID SEARCH CHARSET UTF-8 %s", search->str);
+ response = camel_imap_command (store, folder, NULL,
+ "UID SEARCH CHARSET UTF-8 %s", search->str);
/* We can't actually tell if we got a NO response, so assume always */
if (response == NULL)
store->capabilities &= ~IMAP_CAPABILITY_utf8_search;
diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c
index fc507398db..bb8fdef00a 100644
--- a/camel/providers/imap/camel-imap-utils.c
+++ b/camel/providers/imap/camel-imap-utils.c
@@ -20,6 +20,7 @@
*
*/
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -30,10 +31,6 @@
#include <time.h>
#include <errno.h>
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
#include "camel-imap-utils.h"
#include "camel-imap-summary.h"
#include "camel-imap-store.h"
@@ -1010,17 +1007,17 @@ imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, int uid, ss
range = TRUE;
else {
if (range) {
- g_string_sprintfa (gset, ":%lu", last_uid);
+ g_string_append_printf (gset, ":%lu", last_uid);
range = FALSE;
}
- g_string_sprintfa (gset, ",%lu", this_uid);
+ g_string_append_printf (gset, ",%lu", this_uid);
}
last_uid = this_uid;
}
if (range)
- g_string_sprintfa (gset, ":%lu", last_uid);
+ g_string_append_printf (gset, ":%lu", last_uid);
*lastuid = uid;
@@ -1136,21 +1133,21 @@ imap_mailbox_encode (const unsigned char *in, size_t inlen)
{
char *buf;
- buf = alloca(inlen+1);
- memcpy(buf, in, inlen);
+ buf = g_alloca (inlen + 1);
+ memcpy (buf, in, inlen);
buf[inlen] = 0;
-
- return camel_utf8_utf7(buf);
+
+ return camel_utf8_utf7 (buf);
}
char *
imap_mailbox_decode (const unsigned char *in, size_t inlen)
{
char *buf;
-
- buf = alloca(inlen+1);
- memcpy(buf, in, inlen);
+
+ buf = g_alloca (inlen + 1);
+ memcpy (buf, in, inlen);
buf[inlen] = 0;
-
- return camel_utf7_utf8(buf);
+
+ return camel_utf7_utf8 (buf);
}