Debian Codegraph @

debian/patches/01_legacy.patch

raw symbols SCIP
1 Descriptionscip-debian debian mpack 1.6-19 mpack/patches/`01_legacy.patch`#Description.: fixes several bugs, which are described in changelog.
2 Authorscip-debian debian mpack 1.6-19 mpack/patches/`01_legacy.patch`#Author.: Anibal Monsalve Salazar <[email protected]scip-debian . . . identity/`[email protected]`.>
3 Last-Updatescip-debian debian mpack 1.6-19 mpack/patches/`01_legacy.patch`#Last-Update.: 2020-05-13
4
5 Description: changed directory to store temporary files to /tmp.
6 Author: Fabio Augusto De Muzio Tobich <[email protected]>
7 Bug-Debian: https://bugs.debian.org/869259
8 Last-Update: 2020-05-27
9 --- mpack-1.6.orig/unixunpk.manscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/unixunpk.man`:
10 +++ mpack-1.6/unixunpk.manscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/unixunpk.man`:
11 @@ -50,7 +50,7 @@
12 appends ".1", ".2", etc to find a nonexistent file.
13 .TP
14 .B \-q
15 -Be quiet. Supresses messages about saving partial messages and about
16 +Be quiet. Suppresses messages about saving partial messages and about
17 messages with no interesting information.
18 .TP
19 .B \-t
20 @@ -107,7 +107,7 @@
21 .SH ENVIRONMENT
22 .TP
23 .B TMPDIR
24 -Directory to store temporary files. Default is /usr/tmp.
25 +Directory to store temporary files. Default is /tmp.
26 .SH FILES
27 .TP
28 .B $TMPDIR/m-prts-$USER/
29 --- mpack-1.6.orig/part.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/part.c`:
30 +++ mpack-1.6/part.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/part.c`:
31 @@ -27,6 +27,7 @@
32 */
33
34 #include <stdio.h>
35 +#include <stdlib.h>
36 #include <string.h>
37
38 #include "part.h"
39 @@ -58,7 +59,7 @@
40 /*
41 * Close and free 'part'.
42 */
43 -int part_close(struct part *part)
44 +void part_close(struct part *part)
45 {
46 fclose(part->infile);
47 if (part->buf) free(part->buf);
48 @@ -77,8 +78,7 @@
49 /*
50 * Add to 'part' the multipart boundary 'boundary'.
51 */
52 -int
53 -part_addboundary(struct part *part, char *boundary)
54 +void part_addboundary(struct part *part, char *boundary)
55 {
56 /* Grow boundary array if necessary */
57 if (part->boundary_num == part->boundary_alloc) {
58 @@ -165,8 +165,7 @@
59 * Leaves room in the input buffer to push back an additional single
60 * character using the prot_ungetc() macro.
61 */
62 -int
63 -part_ungets(char *s, struct part *part)
64 +void part_ungets(char *s, struct part *part)
65 {
66 int len = strlen(s);
67 int i;
68 --- mpack-1.6.orig/decode.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/decode.c`:
69 +++ mpack-1.6/decode.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/decode.c`:
70 @@ -26,8 +26,10 @@
71 * SOFTWARE. */
72
73 #include <stdio.h>
74 +#include <stdlib.h>
75 #include <string.h>
76 #include <ctype.h>
77 +#include <unistd.h>
78 #include "xmalloc.h"
79 #include "common.h"
80 #include "part.h"
81 @@ -37,6 +39,19 @@
82 extern FILE *os_newtypedfile(char *fname, char *contentType, int flags, params contentParams);
83 extern FILE *os_createnewfile(char *fname);
84 extern char *md5contextTo64(MD5_CTX *context);
85 +extern void warn(char *s);
86 +extern void os_perror(char *str);
87 +extern void chat(char *s);
88 +extern void os_donewithdir(char *dir);
89 +extern void os_warnMD5mismatch(void);
90 +extern void os_closetypedfile(FILE *outfile);
91 +
92 +extern int part_depth(struct part *part);
93 +extern void part_ungets(char *s, struct part *part);
94 +extern void part_close(struct part *part);
95 +extern int part_fill(struct part *part);
96 +extern void part_addboundary(struct part *part, char *boundary);
97 +extern int part_readboundary(struct part *part);
98
99 /* The possible content transfer encodings */
100 enum encoding { enc_none, enc_qp, enc_base64 };
101 @@ -49,6 +64,17 @@
102 void from64(struct part *inpart, FILE *outfile, char **digestp, int suppressCR);
103 void fromqp(struct part *inpart, FILE *outfile, char **digestp);
104 void fromnone(struct part *inpart, FILE *outfile, char **digestp);
105 +int handlePartial(struct part *inpart, char *headers, params contentParams,
106 + int extractText);
107 +int ignoreMessage(struct part *inpart);
108 +int handleMultipart(struct part *inpart, char *contentType,
109 + params contentParams, int extractText);
110 +int handleUuencode(struct part *inpart, char *subject, int extractText);
111 +int handleText(struct part *inpart, enum encoding contentEncoding);
112 +int saveToFile(struct part *inpart, int inAppleDouble, char *contentType,
113 + params contentParams, enum encoding contentEncoding,
114 + char *contentDisposition, char *contentMD5);
115 +
116 /*
117 * Read and handle an RFC 822 message from the body-part 'inpart'.
118 */
119 @@ -545,8 +571,8 @@
120 SkipWhitespace(&disposition);
121 if (!disposition) return 0;
122
123 - /* If we're looking at a ";", we found what we're looking for */
124 - if (*disposition++ == ';') break;
125 + /* If we're looking at a "=", we found what we're looking for */
126 + if (*disposition++ == '=') break;
127 }
128
129 SkipWhitespace(&disposition);
130 @@ -624,7 +650,7 @@
131 }
132 thispart = atoi(p);
133
134 - if (p = getParam(contentParams, "total")) {
135 + if ((p = getParam(contentParams, "total"))) {
136 nparts = atoi(p);
137 if (nparts <= 0) {
138 warn("partial message has invalid number of parts");
139 @@ -643,7 +669,7 @@
140 else {
141 /* Try to retrieve number of parts from reassembly directory */
142 sprintf(buf, "%sCT", dir);
143 - if (partfile = fopen(buf, "r")) {
144 + if ((partfile = fopen(buf, "r"))) {
145 if (fgets(buf, sizeof(buf), partfile)) {
146 nparts = atoi(buf);
147 if (nparts < 0) nparts = 0;
148 --- mpack-1.6.orig/unixpk.manscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/unixpk.man`:
149 +++ mpack-1.6/unixpk.manscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/unixpk.man`:
150 @@ -4,6 +4,9 @@
151 .SH SYNOPSIS
152 .B mpack
153 [
154 +.B \-a
155 +]
156 +[
157 .B \-s
158 .I subject
159 ]
160 @@ -24,6 +27,9 @@
161 .br
162 .B mpack
163 [
164 +.B \-a
165 +]
166 +[
167 .B \-s
168 .I subject
169 ]
170 @@ -45,6 +51,9 @@
171 .br
172 .B mpack
173 [
174 +.B \-a
175 +]
176 +[
177 .B \-s
178 .I subject
179 ]
180 @@ -74,6 +83,10 @@
181 .PP
182 .SH OPTIONS
183 .TP
184 +.BI \-a
185 +Set the Content-Disposition to attachment. If \-a is not used
186 +the Content-Disposition is inline.
187 +.TP
188 .BI \-s " subject"
189 Set the
190 .B Subject
191 @@ -136,7 +149,7 @@
192 .SH ENVIRONMENT
193 .TP
194 .B TMPDIR
195 -Directory to store temporary files. Default is /usr/tmp.
196 +Directory to store temporary files. Default is /tmp.
197 .TP
198 .B SPLITSIZE
199 Default value of the -m switch.
200 --- mpack-1.6.orig/xmalloc.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/xmalloc.c`:
201 +++ mpack-1.6/xmalloc.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/xmalloc.c`:
202 @@ -23,14 +23,14 @@
203 * SOFTWARE.
204 */
205 #include <stdio.h>
206 +#include <stdlib.h>
207 #include <string.h>
208 -extern char *malloc(), *realloc();
209
210 char *xmalloc (int size)
211 {
212 char *ret;
213
214 - if (ret = malloc((unsigned) size))
215 + if ((ret = malloc((unsigned) size)))
216 return ret;
217
218 fprintf(stderr, "Memory exhausted\n");
219 @@ -43,7 +43,7 @@
220 char *ret;
221
222 /* xrealloc (NULL, size) behaves like xmalloc (size), as in ANSI C */
223 - if (ret = !ptr ? malloc ((unsigned) size) : realloc (ptr, (unsigned) size))
224 + if ((ret = !ptr ? malloc ((unsigned) size) : realloc (ptr, (unsigned) size)))
225 return ret;
226
227 fprintf(stderr, "Memory exhausted\n");
228 --- mpack-1.6.orig/codes.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/codes.c`:
229 +++ mpack-1.6/codes.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/codes.c`:
230 @@ -128,7 +128,7 @@
231 int nbytes;
232
233 MD5Init(&context);
234 - while (nbytes = fread(buf, 1, sizeof(buf), infile)) {
235 + while ((nbytes = fread(buf, 1, sizeof(buf), infile))) {
236 length += nbytes;
237 MD5Update(&context, buf, nbytes);
238 }
239 --- mpack-1.6.orig/unixos.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/unixos.c`:
240 +++ mpack-1.6/unixos.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/unixos.c`:
241 @@ -23,24 +23,30 @@
242 * SOFTWARE.
243 */
244 #include <stdio.h>
245 +#include <stdlib.h>
246 #include <ctype.h>
247 #include <string.h>
248 #include <errno.h>
249 #include <sys/types.h>
250 +#include <sys/stat.h>
251 #include <sys/param.h>
252 +#include <time.h>
253 #include <netdb.h>
254 #include <fcntl.h>
255 +#include <unistd.h>
256 #include "xmalloc.h"
257 #include "common.h"
258 #include "part.h"
259
260 +extern void warn(char *s);
261 +
262 #ifndef MAXHOSTNAMELEN
263 #define MAXHOSTNAMELEN 64
264 #endif
265
266 +#ifndef errno
267 extern int errno;
268 -extern char *malloc();
269 -extern char *getenv();
270 +#endif
271
272 int overwrite_files = 0;
273 int didchat;
274 @@ -76,7 +82,7 @@
275 }
276
277 result = malloc(25+strlen(hostname));
278 - sprintf(result, "%d.%d@%s", pid, curtime++, hostname);
279 + sprintf(result, "%d.%lu@%s", pid, (unsigned long) curtime++, hostname);
280 return result;
281 }
282
283 @@ -90,7 +96,7 @@
284 strcpy(buf, getenv("TMPDIR"));
285 }
286 else {
287 - strcpy(buf, "/usr/tmp");
288 + strcpy(buf, "/tmp");
289 }
290 strcat(buf, "/m-prts-");
291 p = getenv("USER");
292 @@ -137,7 +143,14 @@
293 FILE *ret;
294
295 #ifdef O_EXCL
296 - fd=open(fname, O_RDWR|O_CREAT|O_EXCL, 0644);
297 + struct stat statbuf;
298 +
299 + if ((stat(fname, &statbuf) == 0) && (S_ISCHR(statbuf.st_mode))) {
300 + fd=open(fname, O_RDWR);
301 + }
302 + else {
303 + fd=open(fname, O_RDWR|O_CREAT|O_EXCL, 0644);
304 + }
305 #else
306 fd=open(fname, O_RDWR|O_CREAT|O_TRUNC, 0644);
307 #endif
308 @@ -194,7 +207,7 @@
309 do {
310 if (outfile) fclose(outfile);
311 sprintf(buf, "part%d", ++filesuffix);
312 - } while (outfile = fopen(buf, "r"));
313 + } while ((outfile = fopen(buf, "r")));
314 fname = buf;
315 }
316 else if (!overwrite_files && (outfile = fopen(fname, "r"))) {
317 @@ -202,7 +215,7 @@
318 fclose(outfile);
319 sprintf(buf, "%s.%d", fname, ++filesuffix);
320
321 - } while (outfile = fopen(buf, "r"));
322 + } while ((outfile = fopen(buf, "r")));
323 fname = buf;
324 }
325
326 @@ -228,7 +241,7 @@
327
328 p = strchr(descfname, '/');
329 if (!p) p = descfname;
330 - if (p = strrchr(p, '.')) *p = '\0';
331 + if ((p = strrchr(p, '.'))) *p = '\0';
332
333 strcat(descfname, ".desc");
334 (void) rename(TEMPFILENAME, descfname);
335 --- mpack-1.6.orig/unixunpk.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/unixunpk.c`:
336 +++ mpack-1.6/unixunpk.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/unixunpk.c`:
337 @@ -23,17 +23,19 @@
338 * SOFTWARE.
339 */
340 #include <stdio.h>
341 +#include <stdlib.h>
342 +#include <getopt.h>
343 +#include <unistd.h>
344 #include "version.h"
345 #include "part.h"
346
347 -extern int optind;
348 -extern char *optarg;
349 -
350 extern int overwrite_files;
351 extern int didchat;
352 int quiet;
353
354 void usage(void);
355 +int handleMessage(struct part *inpart, char *defaultContentType,
356 + int inAppleDouble, int extractText);
357
358 int main(int argc, char **argv)
359 {
360 @@ -100,7 +102,7 @@
361
362 void usage(void) {
363 fprintf(stderr, "munpack version %s\n", MPACK_VERSION);
364 - fprintf(stderr, "usage: munpack [-f] [-q] [-C directory] [files...]\n");
365 + fprintf(stderr, "usage: munpack [-f] [-q] [-t] [-C directory] [files...]\n");
366 exit(1);
367 }
368
369 --- mpack-1.6.orig/magic.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/magic.c`:
370 +++ mpack-1.6/magic.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/magic.c`:
371 @@ -23,6 +23,7 @@
372 * SOFTWARE.
373 */
374 #include <stdio.h>
375 +#include <string.h>
376
377 /* Description of the various file formats and their magic numbers */
378 struct magic {
379 --- mpack-1.6.orig/uudecode.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/uudecode.c`:
380 +++ mpack-1.6/uudecode.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/uudecode.c`:
381 @@ -23,8 +23,10 @@
382 * SOFTWARE.
383 */
384 #include <stdio.h>
385 +#include <stdlib.h>
386 #include <ctype.h>
387 #include <string.h>
388 +#include <unistd.h>
389 #include "xmalloc.h"
390 #include "common.h"
391 #include "part.h"
392 @@ -32,9 +34,25 @@
393 extern char *os_idtodir(char *id);
394 extern FILE *os_newtypedfile(char *fname, char *contentType, int flags, params contentParams);
395 extern FILE *os_createnewfile(char *fname);
396 +extern int os_binhex(struct part *inpart, int part, int nparts);
397 +extern void os_closetypedfile(FILE *outfile);
398 +extern void os_donewithdir(char *dir);
399 +extern void os_perror(char *str);
400 +extern void chat(char *s);
401 +
402 +extern void part_ungets(char *s, struct part *part);
403 +extern void part_close(struct part *part);
404 +extern int handleMessage(struct part *inpart, char *defaultContentType,
405 + int inAppleDouble, int extractText);
406
407 static FILE *startDescFile(char *fname);
408 +static void uudecodeline(char *line, FILE *outfile);
409
410 +int parseSubject(char *subject, char **fnamep, int *partp, int *npartsp);
411 +int saveUuFile(struct part *inpart, char *fname, int part, int nparts,
412 + char *firstline);
413 +int descEnd(char *line);
414 +int uudecodefiles(char *dir, int nparts);
415
416 /* Length of a normal uuencoded line, including newline */
417 #define UULENGTH 62
418 @@ -266,7 +284,7 @@
419 }
420 else if (part == 1 && fname && !descfile &&
421 !strncasecmp(buf, "x-file-desc: ", 13)) {
422 - if (descfile = startDescFile(fname)) {
423 + if ((descfile = startDescFile(fname))) {
424 fputs(buf+13, descfile);
425 fclose(descfile);
426 descfile = 0;
427 @@ -454,7 +472,7 @@
428 /* Retrieve any previously saved number of the last part */
429 if (nparts == 0) {
430 sprintf(buf, "%sCT", dir);
431 - if (partfile = fopen(buf, "r")) {
432 + if ((partfile = fopen(buf, "r"))) {
433 if (fgets(buf, sizeof(buf), partfile)) {
434 nparts = atoi(buf);
435 if (nparts < 0) nparts = 0;
436 @@ -722,7 +740,7 @@
437 if (!*fname) return 1;
438
439 /* Guess the content-type of common filename extensions */
440 - if (p = strrchr(fname, '.')) {
441 + if ((p = strrchr(fname, '.'))) {
442 if (!strcasecmp(p, ".gif")) contentType = "image/gif";
443 if (!strcasecmp(p, ".jpg")) contentType = "image/jpeg";
444 if (!strcasecmp(p, ".jpeg")) contentType = "image/jpeg";
445 @@ -826,7 +844,7 @@
446 /*
447 * Decode a uuencoded line to 'outfile'
448 */
449 -int uudecodeline(char *line, FILE *outfile)
450 +static void uudecodeline(char *line, FILE *outfile)
451 {
452 int c, len;
453
454 @@ -845,7 +863,6 @@
455 }
456 line += 4;
457 }
458 - return;
459 }
460
461
462 --- mpack-1.6.orig/md5.hscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/md5.h`:
463 +++ mpack-1.6/md5.hscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/md5.h`:
464 @@ -34,14 +34,16 @@
465 #define PROTOTYPES 0
466 #endif
467
468 +#include <stdint.h>
469 +
470 /* POINTER defines a generic pointer type */
471 typedef unsigned char *POINTER;
472
473 /* UINT2 defines a two byte word */
474 -typedef unsigned short int UINT2;
475 +typedef uint16_t UINT2;
476
477 /* UINT4 defines a four byte word */
478 -typedef unsigned long int UINT4;
479 +typedef uint32_t UINT4;
480
481 /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
482 If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
483 --- mpack-1.6.orig/mkreadme.plscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/mkreadme.pl`:
484 +++ mpack-1.6/mkreadme.plscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/mkreadme.pl`:
485 @@ -413,7 +413,7 @@
486 =unix
487 TMPDIR
488 Root of directory to store partial messages awaiting
489 - reassembly. Default is "/usr/tmp". Partial messages
490 + reassembly. Default is "/tmp". Partial messages
491 are stored in subdirectories of $TMPDIR/m-prts-$USER/
492
493 =pc os2
494 --- mpack-1.6.orig/README.unixscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/README.unix`:
495 +++ mpack-1.6/README.unixscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/README.unix`:
496 @@ -188,7 +188,7 @@
497
498 TMPDIR
499 Root of directory to store partial messages awaiting
500 - reassembly. Default is "/usr/tmp". Partial messages
501 + reassembly. Default is "/tmp". Partial messages
502 are stored in subdirectories of $TMPDIR/m-prts-$USER/
503
504
505 --- mpack-1.6.orig/unixpk.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/unixpk.c`:
506 +++ mpack-1.6/unixpk.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/unixpk.c`:
507 @@ -23,23 +23,28 @@
508 * SOFTWARE.
509 */
510 #include <stdio.h>
511 +#include <stdlib.h>
512 #include <string.h>
513 #include <errno.h>
514 +#include <getopt.h>
515 +#include <sys/types.h>
516 +#include <sys/wait.h>
517 +#include <unistd.h>
518 #include "common.h"
519 #include "version.h"
520 #include "xmalloc.h"
521
522 #define MAXADDRESS 100
523
524 -extern char *getenv();
525 -
526 -extern int errno;
527 -extern int optind;
528 -extern char *optarg;
529 +extern int attachment;
530
531 void usage(void);
532 void sendmail(FILE *infile, char **addr, int start);
533 void inews(FILE *infile);
534 +void os_perror(char *str);
535 +int encode(FILE *infile, FILE *applefile, char *fname, FILE *descfile,
536 + char *subject, char *headers, long int maxsize,
537 + char *typeoverride, char *outfname);
538
539 int main(int argc, char **argv)
540 {
541 @@ -64,7 +69,7 @@
542 maxsize = atoi(p);
543 }
544
545 - while ((opt = getopt(argc, argv, "s:d:m:c:o:n:")) != EOF) {
546 + while ((opt = getopt(argc, argv, "as:d:m:c:o:n:")) != EOF) {
547 switch (opt) {
548 case 's':
549 subject = optarg;
550 @@ -90,6 +95,10 @@
551 newsgroups = optarg;
552 break;
553
554 + case 'a':
555 + attachment = 1;
556 + break;
557 +
558 default:
559 usage();
560
561 @@ -155,7 +164,7 @@
562 fprintf(stderr, "A subject is required\n");
563 usage();
564 }
565 - if (p = strchr(sbuf, '\n')) *p = '\0';
566 + if ((p = strchr(sbuf, '\n'))) *p = '\0';
567 subject = sbuf;
568 }
569
570 @@ -164,7 +173,7 @@
571 strcpy(fnamebuf, getenv("TMPDIR"));
572 }
573 else {
574 - strcpy(fnamebuf, "/usr/tmp");
575 + strcpy(fnamebuf, "/tmp");
576 }
577 strcat(fnamebuf, "/mpackXXXXXX");
578 mktemp(fnamebuf);
579 --- mpack-1.6.orig/encode.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6.orig/encode.c`:
580 +++ mpack-1.6/encode.cscip-debian debian mpack 1.6-19 mpack/upstream/`mpack-1.6/encode.c`:
581 @@ -23,14 +23,18 @@
582 * SOFTWARE.
583 */
584 #include <stdio.h>
585 +#include <stdlib.h>
586 #include <string.h>
587
588 extern char *magic_look(FILE *infile);
589 extern char *os_genid(void);
590 extern FILE *os_createnewfile(char *fname);
591 extern char *md5digest(FILE *infile, long int *len);
592 +extern void os_perror(char *str);
593 +extern int to64(FILE *infile, FILE *outfile, long int limit);
594
595 #define NUMREFERENCES 4
596 +int attachment;
597
598 /*
599 * Encode a file into one or more MIME messages, each
600 @@ -43,7 +47,7 @@
601 char *type;
602 FILE *outfile;
603 char *cleanfname, *p;
604 - char *digest, *appledigest;
605 + char *digest, *appledigest = NULL;
606 long filesize, l, written;
607 int thispart, numparts = 1;
608 int wrotefiletype = 0;
609 @@ -57,12 +61,12 @@
610 /* This filename-cleaning knowledge will probably
611 * be moved to the os layer in a future version.
612 */
613 - if (p = strrchr(cleanfname, '.')) cleanfname = p+1;
614 + if ((p = strrchr(cleanfname, '.'))) cleanfname = p+1;
615 #else
616 - if (p = strrchr(cleanfname, '/')) cleanfname = p+1;
617 - if (p = strrchr(cleanfname, '\\')) cleanfname = p+1;
618 + if ((p = strrchr(cleanfname, '/'))) cleanfname = p+1;
619 + if ((p = strrchr(cleanfname, '\\'))) cleanfname = p+1;
620 #endif
621 - if (p = strrchr(cleanfname, ':')) cleanfname = p+1;
622 + if ((p = strrchr(cleanfname, ':'))) cleanfname = p+1;
623
624 /* Find file type */
625 if (typeoverride) {
626 @@ -189,8 +193,8 @@
627 "Content-Type: multipart/appledouble; boundary=\"=\"; name=\"%s\"\n",
628 cleanfname);
629 fprintf(outfile,
630 - "Content-Disposition: inline; filename=\"%s\"\n",
631 - cleanfname);
632 + "Content-Disposition: %s; filename=\"%s\"\n",
633 + attachment ? "attachment" : "inline", cleanfname);
634 fprintf(outfile, "\n\n--=\n");
635 fprintf(outfile, "Content-Type: application/applefile\n");
636 fprintf(outfile, "Content-Transfer-Encoding: base64\n");
637 @@ -219,8 +223,8 @@
638 fprintf(outfile, "Content-Type: %s; name=\"%s\"\n", type,
639 cleanfname);
640 fprintf(outfile, "Content-Transfer-Encoding: base64\n");
641 - fprintf(outfile, "Content-Disposition: inline; filename=\"%s\"\n",
642 - cleanfname);
643 + fprintf(outfile, "Content-Disposition: %s; filename=\"%s\"\n",
644 + attachment ? "attachment" : "inline", cleanfname);
645 fprintf(outfile, "Content-MD5: %s\n\n", digest);
646 free(digest);
647 written += 80;