bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] mu_message_get_attachment_name bug


From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] mu_message_get_attachment_name bug
Date: Thu, 01 Apr 2010 19:47:12 +0300

Kostik <address@hidden> ha escrit:

> I try to start using libmailutils to create my own little mailfilter. And I
> got a problem with "mu_message_aget_attachment_name".
> [which] returns wrong name size. Because "_ISSPECIAL" not like dot(and some 
> other
> chars) in param.

That macro is overly stringent. According to RFC 2045, dot is not a
special character. Attached is a patch that fixes it. Thanks for
reporting!

Regards,
Sergey

diff --git a/mailbox/attachment.c b/mailbox/attachment.c
index 349f281..55e546f 100644
--- a/mailbox/attachment.c
+++ b/mailbox/attachment.c
@@ -185,11 +185,8 @@ _attachment_free (struct _msg_info *info, int free_message)
   free (info);
 }
 
-#define _ISSPECIAL(c) ( \
-    ((c) == '(') || ((c) == ')') || ((c) == '<') || ((c) == '>') \
-    || ((c) == '@') || ((c) == ',') || ((c) == ';') || ((c) == ':') \
-    || ((c) == '\\') || ((c) == '.') || ((c) == '[') \
-    || ((c) == ']') )
+/* See RFC 2045, 5.1.  Syntax of the Content-Type Header Field */
+#define _ISSPECIAL(c) !!strchr ("()<>@,;:\\\"/[]?=", c)
 
 static char *
 _header_get_param (char *field_body, const char *param, size_t *len)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]