summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2003-05-28 15:01:08 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2003-05-28 15:01:08 +0000
commit67a9efa3986dcafc1c76f0d04ce21a63956a1b48 (patch)
treedc8325df2b66061f6f9dfe7c11e0bc75d45b8461
parent5c6c39acd94dd1e23950e2e5fd85b706d6fffc60 (diff)
downloadmailutils-67a9efa3986dcafc1c76f0d04ce21a63956a1b48.tar.gz
mailutils-67a9efa3986dcafc1c76f0d04ce21a63956a1b48.tar.bz2
(store_handler): Honor the "name" attribute of the Content-Type header.
-rw-r--r--mh/mhn.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/mh/mhn.c b/mh/mhn.c
index f601d8baa..ae854d918 100644
--- a/mh/mhn.c
+++ b/mh/mhn.c
@@ -1579,12 +1579,13 @@ store_handler (message_t msg, msg_part_t part, char *type, char *encoding,
header_t hdr;
char *val;
- if (message_get_header (msg, &hdr) == 0
- && header_aget_value (hdr, MU_HEADER_CONTENT_DISPOSITION, &val) == 0)
+ if (message_get_header (msg, &hdr) == 0)
{
int argc;
char **argv;
+ if (header_aget_value (hdr, MU_HEADER_CONTENT_DISPOSITION, &val) == 0)
+ {
if (argcv_get (val, "=", NULL, &argc, &argv) == 0)
{
int i;
@@ -1603,6 +1604,30 @@ store_handler (message_t msg, msg_part_t part, char *type, char *encoding,
argcv_free (argc, argv);
}
free (val);
+ }
+
+ if (!name
+ && header_aget_value (hdr, MU_HEADER_CONTENT_TYPE, &val) == 0) {
+ if (argcv_get (val, "=", NULL, &argc, &argv) == 0)
+ {
+ int i;
+
+ for (i = 0; i < argc; i++)
+ {
+ if ((strcmp (argv[i], "filename") == 0
+ || strcmp (argv[i], "name") == 0)
+ && ++i < argc
+ && argv[i][0] == '='
+ && ++i < argc)
+ {
+ name = normalize_path (dir, argv[i]);
+ break;
+ }
+ }
+ argcv_free (argc, argv);
+ }
+ free (val);
+ }
}
}

Return to:

Send suggestions and report system problems to the System administrator.