aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-command.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers/imap/camel-imap-command.c')
-rw-r--r--camel/providers/imap/camel-imap-command.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
index 6a2382b3c8..f8ea456439 100644
--- a/camel/providers/imap/camel-imap-command.c
+++ b/camel/providers/imap/camel-imap-command.c
@@ -696,10 +696,14 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
arglen += strlen (store->namespace) + 1;
}
g_ptr_array_add (args, string);
- if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS)
- len += arglen + 15;
- else
- len += arglen * 2;
+ if (imap_is_atom(string)) {
+ len += arglen;
+ } else {
+ if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS)
+ len += arglen + 15;
+ else
+ len += arglen * 2;
+ }
start = p + 1;
break;
@@ -750,16 +754,21 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
string = imap_mailbox_encode (mailbox, strlen (mailbox));
g_free (mailbox);
}
-
- if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS) {
- op += sprintf (op, "{%d+}\r\n%s",
- strlen (string), string);
+
+ if (imap_is_atom(string)) {
+ op += sprintf(op, "%s", string);
} else {
- char *quoted = imap_quote_string (string);
-
- op += sprintf (op, "%s", quoted);
- g_free (quoted);
+ if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS) {
+ op += sprintf (op, "{%d+}\r\n%s",
+ strlen (string), string);
+ } else {
+ char *quoted = imap_quote_string (string);
+
+ op += sprintf (op, "%s", quoted);
+ g_free (quoted);
+ }
}
+
if (*p == 'F')
g_free (string);
break;