Summary: | New patch to be applied to Evolution 1.0.2 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Preston A. Elder <prez> |
Component: | Current packages | Assignee: | Martin Schlemmer (RETIRED) <azarah> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | prez |
Priority: | High | ||
Version: | 1.0 RC6 r14 | ||
Hardware: | x86 | ||
OS: | Linux | ||
URL: | http://bugzilla.ximian.com/show_bug.cgi?id=20553 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Preston A. Elder
2002-03-26 18:19:28 UTC
Since it wont let me attach a file, here is evolution-1.0.2-imapfix.patch: 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) \ OK, so what does it do ? Mail me the patch to azarah@gentoo.org. Fixed in 1.0.3-r1. |