]> git.pld-linux.org Git - packages/metamail.git/blame - metamail-suggestedname.patch
- up to 2.7.52 (fixed core dumps with -w option)
[packages/metamail.git] / metamail-suggestedname.patch
CommitLineData
e0462a81
JB
1--- mm2.7/src/src/metamail/metamail.c.orig 2006-03-20 14:07:16.689062000 +0100
2+++ mm2.7/src/src/metamail/metamail.c 2006-03-21 14:18:29.529062000 +0100
3@@ -67,6 +67,7 @@
e649f9e4 4
5 char *ContentType = NULL,
6 *ContentEncoding = NULL,
7+ *ContentDisposition = NULL,
8 *MailerName = "unknown",
9 *MailSubject = "Mail message",
10 *MailFrom = "unknown sender",
e0462a81 11@@ -157,6 +158,7 @@
e649f9e4 12
13 ContentType = NULL;
14 ContentEncoding = NULL;
15+ ContentDisposition = NULL;
16 MailSubject = "Mail message";
17 MailFrom = "unknown sender";
18 MailSummary = "non-text mail message";
e0462a81
JB
19@@ -385,6 +387,7 @@
20 Fname[0] = 0;
21
e649f9e4 22 suggestedname = FindParam("name");
e0462a81
JB
23+ if (!suggestedname) suggestedname = FindParam("filename");
24 if (strlen(suggestedname) > NAME_MAX - 50)
25 suggestedname[NAME_MAX - 50] = '\0';
e649f9e4 26 if (!suggestedname) {
e0462a81 27@@ -574,7 +577,7 @@
e649f9e4 28 /* strip leading white space */
29 while (*ContentType && isspace((unsigned char) *ContentType)) ++ContentType;
30 StripTrailingSpace(ContentType);
31- ParseContentParameters(ContentType);
32+ ParseContentParameters(0, ContentType);
33 break;
34 case 'd':
35 MightAskBeforeExecuting = 0;
e0462a81 36@@ -1237,6 +1240,7 @@
e649f9e4 37 BoundaryCt=0;
38 return -1;
39 }
40+ ContentDisposition = NULL;
41 for (s=mailheaders+oldbytes; *s; ++s) {
42 if (*s == '\n' && (*(s+1) != ' ') && (*(s+1) != '\t')) {
43 if (!ContentType && !lc2strncmp(s, "\ncontent-type:", 14)) {
e0462a81 44@@ -1259,7 +1263,7 @@
e649f9e4 45 }
46 }
47 StripTrailingSpace(ContentType);
48- ParseContentParameters(ContentType);
49+ ParseContentParameters(0, ContentType);
50 if (PrintHeads) maybephead(s+1);
51 } else if (!ContentEncoding && !lc2strncmp(s, "\ncontent-transfer-encoding:", 27)) {
52 ContentEncoding = FreshHeaderCopy(s+27);
e0462a81 53@@ -1270,9 +1274,13 @@
e649f9e4 54 } else if (!lc2strncmp(s, "\nfrom:", 6)) {
55 if (PrintHeads) maybephead(s+1);
56 MailFrom = FreshHeaderCopy(s+6);
57- } else if (!lc2strncmp(s, "\ncontent-description:", 4)) {
58+ } else if (!lc2strncmp(s, "\ncontent-description:", 21)) {
59 if(PrintHeads) maybephead(s+1);
60 MailSubject = FreshHeaderCopy(s+21);
61+ } else if (!ContentDisposition && !lc2strncmp(s, "\ncontent-disposition:", 21)) {
62+ ContentDisposition = FreshHeaderCopy(s+21);
63+ StripTrailingSpace(ContentDisposition);
64+ ParseContentParameters(CParamsUsed, ContentDisposition);
65 } else {
66 /* Print any with encoded variables */
67 char *dum = s;
e0462a81 68@@ -2111,12 +2119,13 @@
e649f9e4 69 }
70
71 void
72-ParseContentParameters(ct)
73+ParseContentParameters(pc, ct)
74+int pc;
75 char *ct;
76 {
77 char *s, *t, *eq;
78
79- CParamsUsed = 0;
80+ CParamsUsed = pc;
81 s = index(ct, ';');
82 if (!s) return;
83 *s++ = 0;
This page took 0.039476 seconds and 4 git commands to generate.