diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-02-05 01:18:10 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-02-05 01:18:10 +0000 |
commit | aca3bfcc5970b7b00d8dc09a87bb4163f5ce9a69 (patch) | |
tree | 8eb8e61444bbd7f3ab9868544f4998eebcc1694d | |
parent | 6dd77f5075bbb6293d5feb1ccd4c8ab05d6b6fb8 (diff) | |
download | mailutils-aca3bfcc5970b7b00d8dc09a87bb4163f5ce9a69.tar.gz mailutils-aca3bfcc5970b7b00d8dc09a87bb4163f5ce9a69.tar.bz2 |
* mailbox/header.c (header_readline): Bugfix: account for
multi-line headers.
* imap4d/list.c (imap4d_list): Speed up LIST "" INBOX.
* libproto/imap/folder.c (folder_imap_list): Remove erroneous
assignments to f_imap->folder.
Fix handling of remote mailboxes in clients:
* libproto/imap/url.c (_url_imap_init,_url_imaps_init): Remove
call to mu_url_init.
* libproto/pop/url.c (_url_pop_init): Remove call to mu_url_init.
* mailbox/mailbox.c (mailbox_folder_create): Bugfix: Lack of path
component is not an error.
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | imap4d/list.c | 3 | ||||
-rw-r--r-- | libproto/imap/folder.c | 2 | ||||
-rw-r--r-- | libproto/imap/url.c | 16 | ||||
-rw-r--r-- | libproto/pop/url.c | 7 | ||||
-rw-r--r-- | mailbox/header.c | 14 |
6 files changed, 40 insertions, 19 deletions
@@ -1,3 +1,20 @@ +2008-02-05 Sergey Poznyakoff <gray@gnu.org.ua> + + * mailbox/header.c (header_readline): Bugfix: account for + multi-line headers. + + * imap4d/list.c (imap4d_list): Speed up LIST "" INBOX. + * libproto/imap/folder.c (folder_imap_list): Remove erroneous + assignments to f_imap->folder. + + Fix handling of remote mailboxes in clients: + + * libproto/imap/url.c (_url_imap_init,_url_imaps_init): Remove + call to mu_url_init. + * libproto/pop/url.c (_url_pop_init): Remove call to mu_url_init. + * mailbox/mailbox.c (mailbox_folder_create): Bugfix: Lack of path + component is not an error. + 2008-02-04 Sergey Poznyakoff <gray@gnu.org.ua> * mailbox/msrv.c (struct _mu_m_server): New member `num_children'. diff --git a/imap4d/list.c b/imap4d/list.c index 0e40546d7..369ecbb5c 100644 --- a/imap4d/list.c +++ b/imap4d/list.c @@ -150,7 +150,8 @@ imap4d_list (struct imap4d_command *command, char *arg) (*ref) ? delim : ""); } /* There is only one mailbox in the "INBOX" hierarchy ... INBOX. */ - else if (strcasecmp (ref, "INBOX") == 0) + else if (strcasecmp (ref, "INBOX") == 0 + || (ref[0] == 0 && strcasecmp (wcard, "INBOX") == 0)) { util_out (RESP_NONE, "LIST (\\NoInferiors) NIL INBOX"); } diff --git a/libproto/imap/folder.c b/libproto/imap/folder.c index d718a4d3d..944e9b212 100644 --- a/libproto/imap/folder.c +++ b/libproto/imap/folder.c @@ -995,7 +995,6 @@ folder_imap_list (mu_folder_t folder, const char *ref, void *name, if (name == NULL) name = ""; - f_imap->folder = folder; f_imap->enum_fun = efp; f_imap->enum_stop = 0; f_imap->enum_data = edp; @@ -1025,7 +1024,6 @@ folder_imap_list (mu_folder_t folder, const char *ref, void *name, break; } - f_imap->folder = NULL; f_imap->enum_fun = NULL; f_imap->enum_stop = 0; f_imap->enum_data = NULL; diff --git a/libproto/imap/url.c b/libproto/imap/url.c index 9f73b20fc..f1186362c 100644 --- a/libproto/imap/url.c +++ b/libproto/imap/url.c @@ -49,10 +49,9 @@ url_imap_destroy (mu_url_t url MU_ARG_UNUSED) int _url_imap_init (mu_url_t url) { - int status = mu_url_init (url, MU_IMAP_PORT, "imap"); - if (status) - return status; - + if (url->port == 0) + url->port = MU_IMAP_PORT; + url->_destroy = url_imap_destroy; if(!url->host || url->query) @@ -81,13 +80,12 @@ _url_imap_init (mu_url_t url) int _url_imaps_init (mu_url_t url) { - int status = mu_url_init (url, MU_IMAPS_PORT, "imaps"); - if (status) - return status; - + if (url->port == 0) + url->port = MU_IMAPS_PORT; + url->_destroy = url_imap_destroy; - if(!url->host || url->query) + if (!url->host || url->query) return EINVAL; /* fill in default auth, if necessary */ diff --git a/libproto/pop/url.c b/libproto/pop/url.c index eba710259..c25ce1070 100644 --- a/libproto/pop/url.c +++ b/libproto/pop/url.c @@ -49,10 +49,9 @@ url_pop_destroy (mu_url_t url MU_ARG_UNUSED) int _url_pop_init (mu_url_t url) { - int status = mu_url_init (url, MU_POP_PORT, "pop"); - if (status) - return status; - + if (url->port == 0) + url->port = MU_POP_PORT; + url->_destroy = url_pop_destroy; /* not valid in pop url */ diff --git a/mailbox/header.c b/mailbox/header.c index f423d1317..f1b286bb0 100644 --- a/mailbox/header.c +++ b/mailbox/header.c @@ -1039,6 +1039,7 @@ header_readline (mu_stream_t is, char *buffer, size_t buflen, size_t ent_off; int status; size_t strsize; + char *start, *end; if (is == NULL || buflen == 0) return EINVAL; @@ -1055,11 +1056,18 @@ header_readline (mu_stream_t is, char *buffer, size_t buflen, return 0; } - strsize = MU_STR_SIZE (ent->nlen, ent->vlen) - ent_off; buflen--; /* Account for the terminating nul */ - if (buflen > strsize) - buflen = strsize; + mu_hdrent_fixup (header, ent); + start = MU_HDRENT_NAME (header, ent) + ent_off; + end = strchr (start, '\n'); + if (end) + strsize = end - start + 1; + else + strsize = strlen (start); + if (strsize < buflen) + buflen = strsize; + memcpy (buffer, MU_HDRENT_NAME (header, ent) + ent_off, buflen); buffer[buflen] = 0; mu_hdrent_unroll_fixup (header, ent); |