summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2002-04-02 01:59:03 +0000
committerMartin Schlemmer <azarah@gentoo.org>2002-04-02 01:59:03 +0000
commit15a52717a4b27f857ba957472f5078b919dc7a14 (patch)
tree72f4455ba98d994f357b041685d87e2e7236d9bc /net-mail/evolution
parentfilter crash and imap fixes (diff)
downloadgentoo-2-15a52717a4b27f857ba957472f5078b919dc7a14.tar.gz
gentoo-2-15a52717a4b27f857ba957472f5078b919dc7a14.tar.bz2
gentoo-2-15a52717a4b27f857ba957472f5078b919dc7a14.zip
forgot imap fix
Diffstat (limited to 'net-mail/evolution')
-rw-r--r--net-mail/evolution/files/evolution-1.0.2-imapfix.diff90
1 files changed, 90 insertions, 0 deletions
diff --git a/net-mail/evolution/files/evolution-1.0.2-imapfix.diff b/net-mail/evolution/files/evolution-1.0.2-imapfix.diff
new file mode 100644
index 000000000000..827466a32d4b
--- /dev/null
+++ b/net-mail/evolution/files/evolution-1.0.2-imapfix.diff
@@ -0,0 +1,90 @@
+diff -urN evolution-1.0.2/camel/providers/imap/camel-imap-command.c evolution-1.0.2+imapfix/camel/providers/imap/camel-imap-command.c
+--- evolution-1.0.2/camel/providers/imap/camel-imap-command.c Thu Jan 24 10:56:50 2002
++++ evolution-1.0.2+imapfix/camel/providers/imap/camel-imap-command.c Thu Feb 28 01:18:36 2002
+@@ -687,10 +687,17 @@
+ arglen += strlen (store->namespace) + 1;
+ }
+ g_ptr_array_add (args, string);
+- if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS)
+- len += arglen + 15;
++ if (imap_needs_quoting(string))
++ {
++ if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS)
++ len += arglen + 15;
++ else
++ len += arglen * 2;
++ }
+ else
+- len += arglen * 2;
++ {
++ len += arglen;
++ }
+ start = p + 1;
+ break;
+
+@@ -736,14 +743,21 @@
+ string = args->pdata[i++];
+ if (*p == 'F')
+ string = imap_namespace_concat (store, string);
+- 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 (imap_needs_quoting(string))
++ {
++ 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);
++ }
++ }
++ else
++ {
++ op += sprintf(op, "%s", string);
+ }
+ if (*p == 'F')
+ g_free (string);
+diff -urN evolution-1.0.2/camel/providers/imap/camel-imap-utils.c evolution-1.0.2+imapfix/camel/providers/imap/camel-imap-utils.c
+--- evolution-1.0.2/camel/providers/imap/camel-imap-utils.c Tue Dec 4 14:20:09 2001
++++ evolution-1.0.2+imapfix/camel/providers/imap/camel-imap-utils.c Thu Feb 28 01:18:36 2002
+@@ -270,6 +270,21 @@
+ };
+ #define imap_is_atom_char(ch) (isprint (ch) && !imap_atom_specials[ch])
+
++gboolean
++imap_needs_quoting(const char *in)
++{
++ size_t i, len=strlen(in);
++ if (len == 0)
++ return TRUE;
++ for (i=0; i<len; i++)
++ {
++ if (!imap_is_atom_char(in[i]))
++ return TRUE;
++ }
++ return FALSE;
++}
++
++
+ /**
+ * imap_parse_string_generic:
+ * @str_p: a pointer to a string
+diff -urN evolution-1.0.2/camel/providers/imap/camel-imap-utils.h evolution-1.0.2+imapfix/camel/providers/imap/camel-imap-utils.h
+--- evolution-1.0.2/camel/providers/imap/camel-imap-utils.h Sat Oct 27 14:06:04 2001
++++ evolution-1.0.2+imapfix/camel/providers/imap/camel-imap-utils.h Wed Feb 27 23:38:04 2002
+@@ -49,6 +49,7 @@
+
+ enum { IMAP_STRING, IMAP_NSTRING, IMAP_ASTRING };
+
++gboolean imap_needs_quoting (const char *in);
+ char *imap_parse_string_generic (char **str_p, int *len, int type);
+
+ #define imap_parse_string(str_p, len_p) \