Commit 910d990d authored by Johannes Schindelin's avatar Johannes Schindelin Committed by Richard P. Curnow

Allow Content-Disposition variables like 'filename*0*'

At least one version of Thunderbird produces attachments with a header
like this:

-- snip --
Content-Disposition: attachment;
 filename*0*=ISO-8859-15''%32%30%31%31%20%4E%6F%76%20%32%35%20%66%FC%72%20;
 filename*1*=%4A%6F%68%61%6E%6E%65%73%20%32%2E%6F%64%74
-- snap --

Let's cope with those, too.
Signed-off-by: 's avatarJohannes Schindelin <johannes.schindelin@gmx.de>
parent d7cf0d58
......@@ -225,6 +225,7 @@ struct nvp *make_nvp(struct msg_src *src, char *s, const char *pfx)/*{{{*/
case GOT_NAMEVALUE:
case GOT_NAMEVALUE_CONT:
case GOT_NAMEVALUE_CSET:
case GOT_NAMEVALUE_CCONT:
#ifdef VERBOSE_TEST
fprintf(stderr, " Setting last action to %d\n", current_action);
#endif
......@@ -255,6 +256,7 @@ struct nvp *make_nvp(struct msg_src *src, char *s, const char *pfx)/*{{{*/
append_namevalue(result, name, value);
break;
case GOT_NAMEVALUE_CSET:
case GOT_NAMEVALUE_CCONT:
*mm = 0;
*nn = 0;
*vv = 0;
......@@ -277,7 +279,10 @@ struct nvp *make_nvp(struct msg_src *src, char *s, const char *pfx)/*{{{*/
*mm++ = *vv;
}
*mm = 0;
append_namevalue(result, name, value);
if (current_action == GOT_NAMEVALUE_CSET)
append_namevalue(result, name, value);
else
combine_namevalue(result, name, value);
break;
case GOT_NAMEVALUE_CONT:
*nn = 0;
......
......@@ -112,6 +112,8 @@ Block namevalue {
OWS ; <name:in->out> ; OWS ; [=] -> rhs_normal
OWS ; <name:in->out> ; [*] ; <digits:in->out> ; OWS ; [=] -> rhs_continue
OWS ; <name:in->out> ; [*] ; OWS ; [=] -> rhs_charset
OWS ; <name:in->out> ; [*] ; [0] ; [*] ; OWS ; [=] -> rhs_charset
OWS ; <name:in->out> ; [*] ; [1-9A-Za-z] ; [*] ; OWS ; [=] -> rhs_charset_continue
State rhs_normal
OWS ; <qvalue:in->out> ; OWS -> out_normal
......@@ -125,12 +127,17 @@ Block namevalue {
State rhs_charset
OWS ; <minor:in->out> ; ['] ; ['] ; <value:in->out> ; OWS -> out_charset
State rhs_charset_continue
OWS ; <value:in->out> ; OWS -> out_charset_continue
State out_normal = GOT_NAMEVALUE
-> out
State out_continue = GOT_NAMEVALUE_CONT
-> out
State out_charset = GOT_NAMEVALUE_CSET
-> out
State out_charset_continue = GOT_NAMEVALUE_CCONT
-> out
}
Block major {
......@@ -184,6 +191,7 @@ Group action {
Attr GOT_NAMEVALUE
Attr GOT_NAMEVALUE_CONT
Attr GOT_NAMEVALUE_CSET
Attr GOT_NAMEVALUE_CCONT
Attr GOT_NAME
Attr GOT_NAME_TRAILING_SPACE
Attr GOT_MAJORMINOR
......
......@@ -27,6 +27,7 @@ enum nvp_action {
GOT_NAMEVALUE,
GOT_NAMEVALUE_CONT,
GOT_NAMEVALUE_CSET,
GOT_NAMEVALUE_CCONT,
GOT_NAME,
GOT_NAME_TRAILING_SPACE,
GOT_MAJORMINOR,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment