summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-12-15 05:16:23 +0000
committerParthasarathi Susarla <saps@src.gnome.org>2005-12-15 05:16:23 +0000
commitca2673377d62c011917b16183b068f1906f79f71 (patch)
tree1ae8fcc5afdde4c9c38261ac81c5f4f7b8792a1c
parentb7f75cb687cbf89afeae937f33f2ec18a7987357 (diff)
downloadevolution-data-server-ca2673377d62c011917b16183b068f1906f79f71.tar.gz
Fix #323106:
2005-12-14 Tor Lillqvist <tml@novell.com> Fix #323106: * camel-imap-store.c (camel_imap_store_summary_full_to_path, camel_imap_store_summary_path_to_full): Remove extraneous conversions from IMAP-UTF-7 to UTF-8 and back. * camel-imap-command.c (imap_command_strdup_vprintf): Do the conversion from UTF-8 to IMAP-UTF-7 only just before sending a request. Do it also for %S formats, as that is what the CREATE command uses. But %S is used also for other commands (like LOGIN and LIST), so maybe we really would need a new format that would be used *only* for mailbox (folder) names, assuming it's only mailbox names that use the IMAP-UTF-7 encoding. Or is that what %F is intended for? But why then does CREATE use %S? Committed on behalf of Tor - partha
-rw-r--r--camel/providers/imap/ChangeLog19
-rw-r--r--camel/providers/imap/camel-imap-command.c15
-rw-r--r--camel/providers/imap/camel-imap-store-summary.c4
3 files changed, 32 insertions, 6 deletions
diff --git a/camel/providers/imap/ChangeLog b/camel/providers/imap/ChangeLog
index 3ecf40d2a..59d5ec154 100644
--- a/camel/providers/imap/ChangeLog
+++ b/camel/providers/imap/ChangeLog
@@ -1,3 +1,22 @@
+2005-12-14 Tor Lillqvist <tml@novell.com>
+
+ Fix #323106:
+
+ * camel-imap-store.c (camel_imap_store_summary_full_to_path,
+ camel_imap_store_summary_path_to_full): Remove extraneous
+ conversions from IMAP-UTF-7 to UTF-8 and back.
+
+ * camel-imap-command.c (imap_command_strdup_vprintf): Do the
+ conversion from UTF-8 to IMAP-UTF-7 only just before sending a
+ request. Do it also for %S formats, as that is what the CREATE
+ command uses. But %S is used also for other commands (like LOGIN
+ and LIST), so maybe we really would need a new format that would
+ be used *only* for mailbox (folder) names, assuming it's only
+ mailbox names that use the IMAP-UTF-7 encoding. Or is that what %F
+ is intended for? But why then does CREATE use %S?
+
+ Committed on behalf of Tor - partha
+
2005-12-01 Jeff Cai <jeff.cai@sun.com>
* camel-imap-command.c:(imap_command_strdup_vprintf):
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
index 430f49dd8..3133e36fa 100644
--- a/camel/providers/imap/camel-imap-command.c
+++ b/camel/providers/imap/camel-imap-command.c
@@ -766,11 +766,19 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
case 'S':
case 'F':
string = va_arg (ap, char *);
+ /* NB: string is freed during output */
if (*p == 'F') {
- /* NB: this is freed during output */
char *s = camel_imap_store_summary_full_from_path(store->summary, string);
- string = s?s:camel_utf8_utf7(string);
+ if (s) {
+ string = camel_utf8_utf7(s);
+ g_free(s);
+ } else {
+ string = camel_utf8_utf7(string);
+ }
+ } else {
+ string = camel_utf8_utf7(string);
}
+
arglen = strlen (string);
g_ptr_array_add (args, string);
if (imap_is_atom (string)) {
@@ -835,8 +843,7 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
}
}
- if (*p == 'F')
- g_free (string);
+ g_free (string);
break;
default:
*outptr++ = '%';
diff --git a/camel/providers/imap/camel-imap-store-summary.c b/camel/providers/imap/camel-imap-store-summary.c
index e340dd968..b445e4d5b 100644
--- a/camel/providers/imap/camel-imap-store-summary.c
+++ b/camel/providers/imap/camel-imap-store-summary.c
@@ -195,7 +195,7 @@ camel_imap_store_summary_full_to_path(CamelImapStoreSummary *s, const char *full
} else
path = (char *)full_name;
- return camel_utf7_utf8(path);
+ return g_strdup(path);
}
static guint32 hexnib(guint32 c)
@@ -273,7 +273,7 @@ camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const char *path
camel_utf8_putc(&f, c);
/* merge old path part if required */
- f = camel_utf8_utf7(full);
+ f = g_strdup(full);
if (si) {
full = g_strdup_printf("%s%s", camel_imap_store_info_full_name(s, si), f);
g_free(f);