diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-08-03 08:45:15 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-08-03 08:45:15 +0800 |
commit | 338e936539204e42bbb0a09f30eba984fa939ebc (patch) | |
tree | 1d80cf4e6104fa507b6738f0d26c32bae0dee7e1 /camel | |
parent | 6aa2b61cc756334a5ea43d41c0f5883b41d09f46 (diff) | |
download | gsoc2013-evolution-338e936539204e42bbb0a09f30eba984fa939ebc.tar gsoc2013-evolution-338e936539204e42bbb0a09f30eba984fa939ebc.tar.gz gsoc2013-evolution-338e936539204e42bbb0a09f30eba984fa939ebc.tar.bz2 gsoc2013-evolution-338e936539204e42bbb0a09f30eba984fa939ebc.tar.lz gsoc2013-evolution-338e936539204e42bbb0a09f30eba984fa939ebc.tar.xz gsoc2013-evolution-338e936539204e42bbb0a09f30eba984fa939ebc.tar.zst gsoc2013-evolution-338e936539204e42bbb0a09f30eba984fa939ebc.zip |
Fixes bug #26237.
2002-08-02 Jeffrey Stedfast <fejj@ximian.com>
Fixes bug #26237.
* providers/imap/camel-imap-command.c
(imap_command_strdup_vprintf): Don't prepend any namespace shit in
the %F case.
* providers/imap/camel-imap-utils.c (imap_parse_list_response):
Don't strip off the namespace.
svn path=/trunk/; revision=17693
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 11 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-command.c | 58 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-utils.c | 17 |
3 files changed, 31 insertions, 55 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index c1d32a908b..4391ed5b50 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,14 @@ +2002-08-02 Jeffrey Stedfast <fejj@ximian.com> + + Fixes bug #26237. + + * providers/imap/camel-imap-command.c + (imap_command_strdup_vprintf): Don't prepend any namespace shit in + the %F case. + + * providers/imap/camel-imap-utils.c (imap_parse_list_response): + Don't strip off the namespace. + 2002-08-01 Peter Williams <peterw@ximian.com> * providers/imap/camel-imap-store.c (create_folder): If the folder diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c index 49e23a944f..a0a423dc84 100644 --- a/camel/providers/imap/camel-imap-command.c +++ b/camel/providers/imap/camel-imap-command.c @@ -681,7 +681,7 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt, { GPtrArray *args; const char *p, *start; - char *out, *op, *string; + char *out, *outptr, *string; int num, len, i, arglen; args = g_ptr_array_new (); @@ -701,28 +701,18 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt, start = p + 1; len += 10; break; - case 's': string = va_arg (ap, char *); g_ptr_array_add (args, string); start = p + 1; len += strlen (string); break; - case 'S': case 'F': string = va_arg (ap, char *); arglen = strlen (string); - if (*p == 'F') { - if (store->namespace == NULL) { - if (*string != '\0') /*ok if foldername is "" */ - g_warning ("trying to list folder \"%s\" but no namespace. Hope for the best", string); - arglen += 2; - } else - arglen += strlen (store->namespace) + 1; - } g_ptr_array_add (args, string); - if (imap_is_atom(string)) { + if (imap_is_atom (string)) { len += arglen; } else { if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS) @@ -732,11 +722,9 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt, } start = p + 1; break; - case '%': start = p; break; - default: g_warning ("camel-imap-command is not printf. I don't " "know what '%%%c' means.", *p); @@ -746,62 +734,54 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt, } /* Now write out the string */ - op = out = g_malloc (len + 1); + outptr = out = g_malloc (len + 1); p = start = fmt; i = 0; while (*p) { p = strchr (start, '%'); if (!p) { - strcpy (op, start); + strcpy (outptr, start); break; } else { - strncpy (op, start, p - start); - op += p - start; + strncpy (outptr, start, p - start); + outptr += p - start; } switch (*++p) { case 'd': num = GPOINTER_TO_INT (args->pdata[i++]); - op += sprintf (op, "%d", num); + outptr += sprintf (outptr, "%d", num); break; case 's': string = args->pdata[i++]; - op += sprintf (op, "%s", string); + outptr += sprintf (outptr, "%s", string); break; - case 'S': case 'F': string = args->pdata[i++]; - if (*p == 'F') { - char *mailbox; - - mailbox = imap_namespace_concat (store, string); - string = imap_mailbox_encode (mailbox, strlen (mailbox)); - g_free (mailbox); - } - - if (imap_is_atom(string)) { - op += sprintf(op, "%s", string); + if (*p == 'F') + string = imap_mailbox_encode (string, strlen (string)); + + if (imap_is_atom (string)) { + outptr += sprintf (outptr, "%s", string); } else { if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS) { - op += sprintf (op, "{%d+}\r\n%s", - strlen (string), string); + outptr += sprintf (outptr, "{%d+}\r\n%s", strlen (string), string); } else { char *quoted = imap_quote_string (string); - - op += sprintf (op, "%s", quoted); + + outptr += sprintf (outptr, "%s", quoted); g_free (quoted); } } - + if (*p == 'F') g_free (string); break; - default: - *op++ = '%'; - *op++ = *p; + *outptr++ = '%'; + *outptr++ = *p; } start = *p ? p + 1 : p; diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c index 753e341316..48cadf02d2 100644 --- a/camel/providers/imap/camel-imap-utils.c +++ b/camel/providers/imap/camel-imap-utils.c @@ -347,7 +347,6 @@ imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, ch if (folder) { char *astring, *mailbox; - size_t nlen; /* get the folder name */ word = imap_next_word (word); @@ -360,21 +359,7 @@ imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, ch if (!mailbox) return FALSE; - nlen = strlen (store->namespace); - - if (!strncmp (mailbox, store->namespace, nlen)) { - /* strip off the namespace */ - if (nlen > 0) - memmove (mailbox, mailbox + nlen, (len - nlen) + 1); - *folder = mailbox; - } else if (!g_strcasecmp (mailbox, "INBOX")) { - *folder = mailbox; - } else { - g_warning ("IMAP folder name \"%s\" does not begin with \"%s\"", mailbox, store->namespace); - *folder = mailbox; - } - - return *folder != NULL; + *folder = mailbox; } return TRUE; |