summaryrefslogtreecommitdiff
blob: 8682ac125d0dc2ad837b979e9773ff8ec4e4b07c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
Cleanup the build by adding missing headers, fixing broken prototypes,
incorrect if statements, and all that jazz

--- arc-5.21m/arc-prototypes.h
+++ arc-5.21m/arc-prototypes.h
@@ -0,0 +1,12 @@
+VOID openarc(int);
+int readhdr(struct heads*, FILE*);
+int match(char*, char*);
+VOID closearc(int);
+int unpack(FILE*, FILE*, struct heads*);
+VOID setstamp(char*, unsigned short, unsigned short);
+int crcbuf(int, u_int, u_char*);
+VOID arcdie();
+int move(char*, char*);
+VOID writehdr(struct heads*, FILE*);
+VOID filecopy(FILE*, FILE*, long);
+VOID upper(char*);
--- arc-5.21m/arc.c
+++ arc-5.21m/arc.c
@@ -105,6 +105,7 @@
 static char   **lst;		/* files list */
 static int	lnum;		/* length of files list */
 
+int
 main(num, arg)			/* system entry point */
 	int		num;	/* number of arguments */
 	char	       *arg[];	/* pointers to arguments */
--- arc-5.21m/arc.h
+++ arc-5.21m/arc.h
@@ -94,6 +94,7 @@
 
 #ifndef DONT_DEFINE		/* Defined by arcdata.c */
 #include "arcs.h"
+#include "arc-prototypes.h"
 
 extern int      keepbak;	/* true if saving the old archive */
 #if	!DOS
--- arc-5.21m/arcext.c
+++ arc-5.21m/arcext.c
@@ -26,8 +26,6 @@
 #include <strings.h>
 #endif
 
-VOID	openarc(), closearc(), setstamp();
-int	match(), readhdr(), unpack();
 static	VOID	extfile();
 
 #ifndef	__STDC__
@@ -144,7 +135,7 @@
 		printf("Extracting file: %s\n", fix);
 
 	if (warn && !overlay) {
-		if (f = fopen(fix, "r")) {	/* see if it exists */
+		if ((f = fopen(fix, "r"))) {	/* see if it exists */
 				fclose(f);
 				printf("WARNING: File %s already exists!", fix);
 				fflush(stdout);
--- arc-5.21m/arclzw.c
+++ arc-5.21m/arclzw.c
@@ -663,7 +663,7 @@
 {
 	int             temp;
 
-	while (temp = string_tab[index].next)	/* while more duplicates */
+	while (temp == string_tab[index].next)	/* while more duplicates */
 		index = temp;
 
 	return index;
--- arc-5.21m/arcmisc.c
+++ arc-5.21m/arcmisc.c
@@ -306,7 +306,7 @@
 
 	if (Nnum == 0) {	/* first call */
 		strcpy(namecopy,filename);
-		if(pattern=rindex(namecopy,CUTOFF)) {
+		if((pattern=rindex(namecopy,CUTOFF))) {
 			*pattern = 0;
 			pattern++;
 			dirname = namecopy;
--- arc-5.21m/arcpack.c
+++ arc-5.21m/arcpack.c
@@ -27,7 +27,6 @@
 
 VOID		setcode(), init_cm(), codebuf();
 VOID		arcdie(), init_sq(), flsh_cm();
-int		crcbuf();
 u_int		ncr_buf();
 
 int		lastc;
--- arc-5.21m/arcrun.c
+++ arc-5.21m/arcrun.c
@@ -20,12 +20,14 @@
  */
 #include <stdio.h>
 #include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include "arc.h"
 
 VOID	rempath(), openarc(), closearc(), arcdie();
 int	readhdr(), match(), unpack();
 static	VOID	runfile();
-char	*strcat();
 
 VOID
 runarc(num, arg)		/* run file from archive */
@@ -120,7 +122,7 @@
 #endif
 
 	if (warn)
-		if (tmp = fopen(buf, "r"))
+		if ((tmp = fopen(buf, "r")))
 			arcdie("Temporary file %s already exists", buf);
 	if (!(tmp = fopen(buf, OPEN_W)))
 		arcdie("Unable to create temporary file %s", buf);
@@ -131,7 +133,7 @@
 	dir = gcdir("");	/* see where we are */
 	unpack(arc, tmp, hdr);	/* unpack the entry */
 	fclose(tmp);		/* release the file */
-	chmod(buf, "700");	/* make it executable */
+	chmod(buf, 700);	/* make it executable */
 #if	GEMDOS
 	execve(buf, arg, NULL);
 #else
--- arc-5.21m/arcsvc.c
+++ arc-5.21m/arcsvc.c
@@ -19,15 +19,13 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <unistd.h>
 #include <fcntl.h>
 #include "arc.h"
 #if	_MTS
 #include <mts.h>
 #endif
 
-VOID	arcdie(), setstamp();
-int	unlink();
-
 VOID
 openarc(chg)			/* open archive */
 	int             chg;	/* true to open for changes */
--- arc-5.21m/marc.c
+++ arc-5.21m/marc.c
@@ -26,12 +26,14 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #endif
+#include <unistd.h>
 
 #ifndef	__STDC__
 char *calloc(), *malloc(), *realloc(); /* memory managers */
 #endif
-VOID	arcdie();
 static VOID expandlst(), merge();
+int gethdr(FILE*, struct heads*);
+void copyfile(FILE*, struct heads*, int);
 
 FILE *src;			       /* source archive */
 char srcname[STRLEN];		       /* source archive name */
@@ -295,6 +292,7 @@
     else return 0;		       /* or fake end of archive */
 }
 
+void
 copyfile(f,hdr,ver)		       /* copy a file from an archive */
 FILE *f;			       /* archive to copy from */
 struct heads *hdr;		       /* header data for file */