Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/archivers/arc/files/patch-arcmisc.c
18157 views
1
--- arcmisc.c.orig 2013-06-27 02:00:19 UTC
2
+++ arcmisc.c
3
@@ -6,7 +6,9 @@
4
*/
5
6
#include <stdio.h>
7
+#include <stdarg.h>
8
#include <ctype.h>
9
+#include <unistd.h>
10
#include "arc.h"
11
12
#include <string.h>
13
@@ -68,7 +70,6 @@ chdir(dirname)
14
#define DIRECT direct
15
#endif
16
#include <sys/stat.h>
17
- int rename(), unlink();
18
#include <fcntl.h>
19
#endif
20
21
@@ -110,7 +111,7 @@ move(oldnam, newnam)
22
move(oldnam, newnam)
23
char *oldnam, *newnam;
24
{
25
- FILE *fopen(), *old, *new;
26
+ FILE *old, *new;
27
#if !_MTS
28
struct stat oldstat;
29
#endif
30
@@ -225,11 +226,13 @@ VOID
31
}
32
/* VARARGS1 */
33
VOID
34
-arcdie(s, arg1, arg2, arg3)
35
- char *s;
36
+arcdie(const char *s, ...)
37
{
38
+ va_list args;
39
fprintf(stderr, "ARC: ");
40
- fprintf(stderr, s, arg1, arg2, arg3);
41
+ va_start(args, s);
42
+ vfprintf(stderr, s, args);
43
+ va_end(args);
44
fprintf(stderr, "\n");
45
#if UNIX
46
perror("UNIX");
47
@@ -247,7 +250,6 @@ gcdir(dirname)
48
char *dirname;
49
50
{
51
- char *getcwd();
52
#if GEMDOS
53
int drv;
54
char *buf;
55
@@ -310,11 +312,7 @@ dir(filename) /* get files, one by one */
56
static struct DIRECT **namelist;
57
static char **NameList;
58
static char namecopy[STRLEN], *dirname;
59
-#if UNIX
60
- int alphasort();
61
- int scandir();
62
-#endif /* UNIX */
63
- int fmatch();
64
+ int fmatch(const struct DIRECT *);
65
static int Nnum = 0, ii;
66
67
68
@@ -354,10 +352,9 @@ int
69
*/
70
71
int
72
-fmatch(direntry)
73
- struct DIRECT *direntry;
74
+fmatch(const struct DIRECT *direntry)
75
{
76
- char *string;
77
+ const char *string;
78
79
string = direntry->d_name;
80
81
82