aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-utils.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-09-10 04:28:35 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-09-10 04:28:35 +0800
commit4a52b7b9a9c00a9cb5fecca624c8f5590081e316 (patch)
tree531f6e1f4c876f2f74390e22e2b2ed232d0d75fd /camel/camel-mime-utils.c
parent8269bb5271a836ce733917cb2550d9d1ac5b7f31 (diff)
downloadgsoc2013-evolution-4a52b7b9a9c00a9cb5fecca624c8f5590081e316.tar.gz
gsoc2013-evolution-4a52b7b9a9c00a9cb5fecca624c8f5590081e316.tar.zst
gsoc2013-evolution-4a52b7b9a9c00a9cb5fecca624c8f5590081e316.zip
Fixes bug #4224
2002-09-09 Jeffrey Stedfast <fejj@ximian.com> Fixes bug #4224 * providers/imap/camel-imap-folder.c (camel_imap_folder_fetch_data): Pass ex into camel_imap_message_cache_get(). * providers/imap/camel-imap-message-cache.c (camel_imap_message_cache_get): Now takes an exception and sets it on fail. (camel_imap_message_cache_copy): Updated to properly handle cache_get error conditions. svn path=/trunk/; revision=18027
Diffstat (limited to 'camel/camel-mime-utils.c')
-rw-r--r--camel/camel-mime-utils.c38
1 files changed, 30 insertions, 8 deletions
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index f1a3792f60..d49c41a874 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -1338,7 +1338,7 @@ header_encode_string (const unsigned char *in)
int encoding;
GString *out;
char *outstr;
-
+
g_return_val_if_fail (g_utf8_validate (in, -1, NULL), NULL);
if (in == NULL)
@@ -1350,7 +1350,7 @@ header_encode_string (const unsigned char *in)
break;
inptr++;
}
- if (*inptr == '\0')
+ if (FALSE && *inptr == '\0')
return g_strdup (in);
/* This gets each word out of the input, and checks to see what charset
@@ -1376,9 +1376,20 @@ header_encode_string (const unsigned char *in)
if (g_unichar_isspace (c) && !last_was_space) {
/* we've reached the end of a 'word' */
- if (word && !(last_was_encoded && encoding)) {
- g_string_append_len (out, start, word - start);
- start = word;
+ if (word) {
+ int len = inptr - word;
+
+ printf ("checking word '%.*s'\n", len, word);
+ if (!encoding && len > 8 && !strncmp (word, "=?", 2) && !strncmp (inptr - 2, "?=", 2)) {
+ printf ("yes...\n");
+ encoding = 1;
+ } else
+ printf ("no...\n");
+
+ if (!(last_was_encoded && encoding)) {
+ g_string_append_len (out, start, word - start);
+ start = word;
+ }
}
switch (encoding) {
@@ -1424,9 +1435,20 @@ header_encode_string (const unsigned char *in)
}
if (inptr - start) {
- if (word && !(last_was_encoded && encoding)) {
- g_string_append_len (out, start, word - start);
- start = word;
+ if (word) {
+ int len = inptr - word;
+
+ printf ("checking word '%.*s'\n", len, word);
+ if (!encoding && len > 8 && !strncmp (word, "=?", 2) && !strncmp (inptr - 3, "?=", 2)) {
+ printf ("yes...\n");
+ encoding = 1;
+ } else
+ printf ("no...\n");
+
+ if (!(last_was_encoded && encoding)) {
+ g_string_append_len (out, start, word - start);
+ start = word;
+ }
}
switch (encoding) {