Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-gnome
Path: blob/main/converters/mpack/files/patch-unixpk.c
16151 views
1
--- unixpk.c.orig 2003-07-21 22:50:41.000000000 +0200
2
+++ unixpk.c 2012-01-12 18:56:56.000000000 +0100
3
@@ -23,23 +23,25 @@
4
* SOFTWARE.
5
*/
6
#include <stdio.h>
7
+#include <stdlib.h>
8
#include <string.h>
9
#include <errno.h>
10
+#include <sys/types.h>
11
+#include <sys/wait.h>
12
+#include <unistd.h>
13
#include "common.h"
14
#include "version.h"
15
#include "xmalloc.h"
16
17
#define MAXADDRESS 100
18
19
-extern char *getenv();
20
-
21
-extern int errno;
22
-extern int optind;
23
-extern char *optarg;
24
-
25
void usage(void);
26
void sendmail(FILE *infile, char **addr, int start);
27
void inews(FILE *infile);
28
+void os_perror(char *str);
29
+int encode(FILE *infile, FILE *applefile, char *fname, FILE *descfile,
30
+ char *subject, char *headers, long int maxsize,
31
+ char *typeoverride, char *outfname);
32
33
int main(int argc, char **argv)
34
{
35
@@ -155,7 +157,7 @@
36
fprintf(stderr, "A subject is required\n");
37
usage();
38
}
39
- if (p = strchr(sbuf, '\n')) *p = '\0';
40
+ if ((p = strchr(sbuf, '\n'))) *p = '\0';
41
subject = sbuf;
42
}
43
44
@@ -164,7 +166,7 @@
45
strcpy(fnamebuf, getenv("TMPDIR"));
46
}
47
else {
48
- strcpy(fnamebuf, "/usr/tmp");
49
+ strcpy(fnamebuf, "/tmp");
50
}
51
strcat(fnamebuf, "/mpackXXXXXX");
52
mktemp(fnamebuf);
53
54