If a MIME part has no Content-Disposition, but does have a "name" on the

* camel-mime-part.c (camel_mime_part_get_filename): If a MIME part
	has no Content-Disposition, but does have a "name" on the
	Content-Type, return that as the filename.
	(process_header): strstrip the Content-Description

svn path=/trunk/; revision=5213
This commit is contained in:
Dan Winship
2000-09-05 23:00:22 +00:00
parent eafd7dbe01
commit aaeea6be54
2 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2000-09-05 Dan Winship <danw@helixcode.com>
* camel-mime-part.c (camel_mime_part_get_filename): If a MIME part
has no Content-Disposition, but does have a "name" on the
Content-Type, return that as the filename.
(process_header): strstrip the Content-Description
2000-09-05 Chris Toshok <toshok@helixcode.com>
* providers/nntp/camel-nntp-utils.c (get_OVER_headers): care about

View File

@ -199,7 +199,7 @@ process_header(CamelMedium *medium, const char *header_name, const char *header_
case HEADER_DESCRIPTION: /* raw header->utf8 conversion */
text = header_decode_string(header_value);
g_free(mime_part->description);
mime_part->description = text;
mime_part->description = g_strstrip (text);
break;
case HEADER_DISPOSITION:
set_disposition (mime_part, header_value);
@ -351,9 +351,13 @@ camel_mime_part_set_filename (CamelMimePart *mime_part, const gchar *filename)
const gchar *
camel_mime_part_get_filename (CamelMimePart *mime_part)
{
if (mime_part->disposition)
return header_param(mime_part->disposition->params, "filename");
return NULL;
if (mime_part->disposition) {
const gchar *name = header_param (mime_part->disposition->params, "filename");
if (name)
return name;
}
return gmime_content_field_get_parameter (mime_part->content_type, "name");
}