diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-07-30 15:08:16 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-07-30 15:08:16 +0300 |
commit | 5e98bfdac8061ffef40f35200a4fee5c0331197a (patch) | |
tree | 6b9651dab07e58eb637c3d40b0fa88d6bb0095ec | |
parent | 376d5eef88acdbad3dcfa7f0bd87d9bd66feda61 (diff) | |
download | mailutils-5e98bfdac8061ffef40f35200a4fee5c0331197a.tar.gz mailutils-5e98bfdac8061ffef40f35200a4fee5c0331197a.tar.bz2 |
Bugfixes
* libmailutils/base/ctparse.c (content_type_parse): Initialize rc.
* decodemail/decodemail.c (message_decode): Use the MU_CONTENT_TYPE_PARAM
flag.
* lib/mdecode.c: Likewise.
-rw-r--r-- | decodemail/decodemail.c | 11 | ||||
-rw-r--r-- | lib/mdecode.c | 6 | ||||
-rw-r--r-- | libmailutils/base/ctparse.c | 2 |
3 files changed, 12 insertions, 7 deletions
diff --git a/decodemail/decodemail.c b/decodemail/decodemail.c index cebb6b909..f5b6327b6 100644 --- a/decodemail/decodemail.c +++ b/decodemail/decodemail.c @@ -519,12 +519,13 @@ message_decode (mu_message_t msg, mu_coord_t *crd, size_t dim) size_t len; mu_string_unfold (vc, &len); rc = mu_content_type_parse_ext (vc, NULL, - MU_CONTENT_TYPE_RELAXED, + MU_CONTENT_TYPE_RELAXED | + MU_CONTENT_TYPE_PARAM, &ct); if (rc) { crd_error (*crd, dim, - "mu_content_type_parse(%s): %s", + "mu_content_type_parse_ext(%s): %s", vc, mu_strerror (rc)); free (vc); continue; @@ -609,10 +610,12 @@ message_decode (mu_message_t msg, mu_coord_t *crd, size_t dim) mu_message_ref (msg); return msg; } - rc = mu_content_type_parse_ext (s, NULL, MU_CONTENT_TYPE_RELAXED, &ct); + rc = mu_content_type_parse_ext (s, NULL, + MU_CONTENT_TYPE_RELAXED | + MU_CONTENT_TYPE_PARAM, &ct); if (rc) { - crd_error (*crd, dim, "mu_content_type_parse(%s): %s", + crd_error (*crd, dim, "mu_content_type_parse_ext(%s): %s", s, mu_strerror (rc)); free (s); mu_message_ref (msg); diff --git a/lib/mdecode.c b/lib/mdecode.c index 9f0c4a9e5..36aaed2f8 100644 --- a/lib/mdecode.c +++ b/lib/mdecode.c @@ -215,10 +215,12 @@ message_body_stream (mu_message_t msg, int unix_header, char const *charset, return rc; } - rc = mu_content_type_parse_ext (buf, NULL, MU_CONTENT_TYPE_RELAXED, &ct); + rc = mu_content_type_parse_ext (buf, NULL, + MU_CONTENT_TYPE_RELAXED | + MU_CONTENT_TYPE_PARAM, &ct); if (rc) { - mu_diag_funcall (MU_DIAG_ERROR, "mu_content_type_parse", buf, rc); + mu_diag_funcall (MU_DIAG_ERROR, "mu_content_type_parse_ext", buf, rc); free (buf); return rc; } diff --git a/libmailutils/base/ctparse.c b/libmailutils/base/ctparse.c index c7d11cb95..6d4cf1b4d 100644 --- a/libmailutils/base/ctparse.c +++ b/libmailutils/base/ctparse.c @@ -51,7 +51,7 @@ content_type_parse (const char *input, const char *charset, int flags, mu_content_type_t ct) { - int rc; + int rc = 0; char *value, *p; if (flags & MU_CONTENT_TYPE_PARAM) |