summaryrefslogtreecommitdiff
path: root/archivers/zoo/patches
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2014-06-29 03:24:33 +0000
committerdholland <dholland@pkgsrc.org>2014-06-29 03:24:33 +0000
commit8d16a7c0ab1e3356cbe7fe3ed992ed9ed240d66c (patch)
tree6f6d52f8df55a01668f0e97a55b0e3e884714437 /archivers/zoo/patches
parent7d5b4a2adf2526d646c26c322718725704156f4d (diff)
downloadpkgsrc-8d16a7c0ab1e3356cbe7fe3ed992ed9ed240d66c.tar.gz
Assorted basic legacy code fixes - ctype.h stuff, implicit int, use
standard headers, etc. "time_t" is not "long". Don't issue own declarations of standard functions. Should fix Solaris build.
Diffstat (limited to 'archivers/zoo/patches')
-rw-r--r--archivers/zoo/patches/patch-aa25
-rw-r--r--archivers/zoo/patches/patch-ab63
-rw-r--r--archivers/zoo/patches/patch-ai26
-rw-r--r--archivers/zoo/patches/patch-ak16
-rw-r--r--archivers/zoo/patches/patch-am30
-rw-r--r--archivers/zoo/patches/patch-makelist.c17
-rw-r--r--archivers/zoo/patches/patch-mstime.i14
-rw-r--r--archivers/zoo/patches/patch-zoo.c14
-rw-r--r--archivers/zoo/patches/patch-zooadd.c14
-rw-r--r--archivers/zoo/patches/patch-zoofilt.c27
10 files changed, 209 insertions, 37 deletions
diff --git a/archivers/zoo/patches/patch-aa b/archivers/zoo/patches/patch-aa
index 6242235d956..c357b7d2099 100644
--- a/archivers/zoo/patches/patch-aa
+++ b/archivers/zoo/patches/patch-aa
@@ -1,8 +1,19 @@
-$NetBSD: patch-aa,v 1.5 2009/04/25 23:46:47 gdt Exp $
+$NetBSD: patch-aa,v 1.6 2014/06/29 03:24:33 dholland Exp $
---- ar.h.orig 1993-05-01 06:04:22.000000000 +0200
+- use standard headers
+- don't redeclare memmove
+
+--- ar.h.orig 1993-05-01 04:04:22.000000000 +0000
+++ ar.h
-@@ -15,11 +15,15 @@ Adapted from "ar" archiver written by Ha
+@@ -7,6 +7,7 @@ Adapted from "ar" archiver written by Ha
+ ***********************************************************/
+
+ #include <stdio.h>
++#include <string.h>
+
+ #ifdef ANSI_HDRS
+ # include <limits.h>
+@@ -15,11 +16,15 @@ Adapted from "ar" archiver written by Ha
/* uchar should be 8 bits or more */
/* typedef unsigned char uchar; -- already in zoo.h */
@@ -18,3 +29,11 @@ $NetBSD: patch-aa,v 1.5 2009/04/25 23:46:47 gdt Exp $
/* T_UINT16 must be #defined in options.h to be
a 16-bit unsigned integer type */
+@@ -116,7 +121,6 @@ int make_tree
+ void move_left();
+ #else
+ # define MOVE_LEFT memmove
+- extern VOIDPTR memmove();
+ #endif
+
+ #if 0
diff --git a/archivers/zoo/patches/patch-ab b/archivers/zoo/patches/patch-ab
index 1bf7486525b..57886f809bc 100644
--- a/archivers/zoo/patches/patch-ab
+++ b/archivers/zoo/patches/patch-ab
@@ -1,48 +1,67 @@
-$NetBSD: patch-ab,v 1.5 2009/04/25 23:46:47 gdt Exp $
+$NetBSD: patch-ab,v 1.6 2014/06/29 03:24:33 dholland Exp $
---- bsd.c.orig 1993-05-01 06:21:53.000000000 +0200
+- use standard headers
+- use standard macros for seeking
+- don't declare own lseek
+- use off_t
+- supply missing return value
+
+--- bsd.c.orig 1993-05-01 04:21:53.000000000 +0000
+++ bsd.c
-@@ -69,8 +69,12 @@ ZOOFILE f;
- }
+@@ -26,7 +26,7 @@ to be on the safe side. It is needed fo
+ long lseek PARMS ((int, long, int));
+ long tell (fd)
+ int fd;
+-{ return (lseek (fd, 0L, 1)); }
++{ return (lseek (fd, 0L, SEEK_CUR)); }
+ #endif
- /* Function gettz() returns the offset from GMT in seconds */
--long gettz()
-+long gettz(t)
-+long t;
- {
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
-+ return -localtime(&t)->tm_gmtoff;
-+#else
+ long ftell();
+@@ -74,26 +74,13 @@ long gettz()
#define SEC_IN_DAY (24L * 60L * 60L)
#define INV_VALUE (SEC_IN_DAY + 1L)
static long retval = INV_VALUE; /* cache, init to impossible value */
-@@ -95,6 +99,7 @@ long gettz()
+-#ifndef __386BSD__
+- struct timeval tp;
+- struct timezone tzp;
+-#else
+ time_t lt;
+ struct tm *tm;
+-#endif
+ if (retval != INV_VALUE) /* if have cached value, return it */
+ return retval;
+-#ifndef __386BSD__
+- gettimeofday (&tp, &tzp); /* specific to 4.3BSD */
+- /* return (tzp.tz_minuteswest * 60); */ /* old incorrect code */
+- /* Timezone fix thanks to Bill Davidsen <wedu@ge-crd.ARPA> */
+- /* !! - ache@hq.demos.su */
+- retval = tzp.tz_minuteswest * 60 - (tzp.tz_dsttime != 0) * 3600L;
+-#else
+ time(&lt);
+ tm = localtime(&lt);
retval = -tm->tm_gmtoff;
- #endif
+-#endif
return retval;
-+#endif
}
- /* Standard UNIX-compatible time routines */
-@@ -103,15 +108,19 @@ long gettz()
+@@ -103,6 +90,7 @@ long gettz()
/* Standard UNIX-specific file attribute routines */
#include "nixmode.i"
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#include <unistd.h>
-+#else
#ifndef SEEK_CUR
# define SEEK_CUR 1
#endif
-+#endif
-
+@@ -110,10 +98,10 @@ long gettz()
/* Truncate a file. */
int zootrunc(f) FILE *f;
{
- extern long lseek();
- long seekpos;
-+ extern off_t lseek();
+ off_t seekpos;
int fd = fileno(f);
seekpos = lseek(fd, 0L, SEEK_CUR);
if (seekpos >= 0)
+ return ftruncate(fd, seekpos);
++ return 0;
+ }
diff --git a/archivers/zoo/patches/patch-ai b/archivers/zoo/patches/patch-ai
index e6bd4bd9fec..43c99ac51f7 100644
--- a/archivers/zoo/patches/patch-ai
+++ b/archivers/zoo/patches/patch-ai
@@ -1,8 +1,18 @@
-$NetBSD: patch-ai,v 1.4 2009/04/25 23:46:47 gdt Exp $
+$NetBSD: patch-ai,v 1.5 2014/06/29 03:24:33 dholland Exp $
---- zoolist.c.orig 1991-07-20 00:57:27.000000000 +0200
+- use standard headers
+- use printf formats matching types
+- add zoo_pointer and logic related to it, appears to be a bug fix
+- changes calling gettz() that should be reverted now that gettz() has
+ been fixed up
+
+--- zoolist.c.orig 1991-07-19 22:57:27.000000000 +0000
+++ zoolist.c
-@@ -21,7 +21,7 @@ Copyright (C) 1986, 1987 Rahul Dhesi --
+@@ -18,10 +18,11 @@ duplicate information will be dumped.
+ Copyright (C) 1986, 1987 Rahul Dhesi -- All rights reserved
+ (C) Copyright 1988 Rahul Dhesi -- All rights reserved
+ */
++#include <stdio.h>
#include "options.h"
#include "portable.h"
#include "zoomem.h" /* to get ZOOCOUNT */
@@ -11,7 +21,7 @@ $NetBSD: patch-ai,v 1.4 2009/04/25 23:46:47 gdt Exp $
/* Lists files in archive */
#include "zoo.h"
#include "errors.i"
-@@ -92,6 +92,7 @@ int genson = 1; /* enable/disable ge
+@@ -92,6 +93,7 @@ int genson = 1; /* enable/disable ge
int show_mode = 0; /* show file protection */
#endif
int first_dir = 1; /* if first direntry -- to adjust dat_ofs */
@@ -19,7 +29,7 @@ $NetBSD: patch-ai,v 1.4 2009/04/25 23:46:47 gdt Exp $
while (*option) {
switch (*option) {
-@@ -211,6 +212,9 @@ if (fiz_ofs != 0L) { /* i
+@@ -211,6 +213,9 @@ if (fiz_ofs != 0L) { /* i
show_acmt (&zoo_header, zoo_file, 0); /* show archive comment */
}
@@ -29,7 +39,7 @@ $NetBSD: patch-ai,v 1.4 2009/04/25 23:46:47 gdt Exp $
/* Seek to the beginning of the first directory entry */
if (zooseek (zoo_file, zoo_header.zoo_start, 0) != 0) {
ercount++;
-@@ -414,7 +418,7 @@ if (fiz_ofs != 0L) { /* i
+@@ -414,7 +419,7 @@ if (fiz_ofs != 0L) { /* i
if (direntry.fattr == 0)
printf ("--- ");
else if ((direntry.fattr >> 22) == 1)
@@ -38,7 +48,7 @@ $NetBSD: patch-ai,v 1.4 2009/04/25 23:46:47 gdt Exp $
else
printf ("??? ");
}
-@@ -437,6 +441,11 @@ if (fiz_ofs != 0L) { /* i
+@@ -437,6 +442,11 @@ if (fiz_ofs != 0L) { /* i
if (verb_list && !fast)
show_comment (&direntry, zoo_file, 0, (char *) NULL);
} /* end if (lots of conditions) */
@@ -50,7 +60,7 @@ $NetBSD: patch-ai,v 1.4 2009/04/25 23:46:47 gdt Exp $
/* ..seek to next dir entry */
zooseek (zoo_file, direntry.next, 0);
-@@ -539,10 +548,12 @@ int file_tz;
+@@ -539,10 +549,12 @@ int file_tz;
{
long gettz();
int diff_tz; /* timezone difference */
diff --git a/archivers/zoo/patches/patch-ak b/archivers/zoo/patches/patch-ak
index 08515a33455..196d4838d0d 100644
--- a/archivers/zoo/patches/patch-ak
+++ b/archivers/zoo/patches/patch-ak
@@ -1,7 +1,19 @@
-$NetBSD: patch-ak,v 1.2 2009/04/25 23:46:47 gdt Exp $
+$NetBSD: patch-ak,v 1.3 2014/06/29 03:24:33 dholland Exp $
---- misc.c.orig 1991-07-16 17:52:54.000000000 +0200
+- use <ctype.h> correctly
+- avoid string overflow
+
+--- misc.c.orig 1991-07-16 15:52:54.000000000 +0000
+++ misc.c
+@@ -41,7 +41,7 @@ char *str;
+ char *p;
+ retval = 0L;
+ p = str; /* save for error message */
+- while (isdigit(*str)) {
++ while (isdigit((unsigned char)*str)) {
+ retval = retval * 10L + (*str-'0');
+ str++;
+ }
@@ -135,11 +135,17 @@ if available, else the short filename is
char *fullpath (direntry)
struct direntry *direntry;
diff --git a/archivers/zoo/patches/patch-am b/archivers/zoo/patches/patch-am
index 292d29a894d..255d487be4f 100644
--- a/archivers/zoo/patches/patch-am
+++ b/archivers/zoo/patches/patch-am
@@ -1,6 +1,10 @@
-$NetBSD: patch-am,v 1.2 2009/04/25 23:46:47 gdt Exp $
+$NetBSD: patch-am,v 1.3 2014/06/29 03:24:33 dholland Exp $
---- portable.c.orig 1991-07-16 17:55:11.000000000 +0200
+- provide zoocreate_fd
+- use <ctype.h> properly
+- provide and use to_signed_long (why?)
+
+--- portable.c.orig 1991-07-16 15:55:11.000000000 +0000
+++ portable.c
@@ -87,6 +87,12 @@ ZOOFILE zoocreate (fname)
char *fname;
@@ -15,6 +19,28 @@ $NetBSD: patch-am,v 1.2 2009/04/25 23:46:47 gdt Exp $
#endif /* FIZ */
#ifndef zooseek
+@@ -133,7 +139,7 @@ char *str;
+ s = str;
+ while (*s != '\0') {
+ *s = toascii(*s);
+- *s = low_ch(*s);
++ *s = low_ch((unsigned char)*s);
+ s++;
+ }
+ return (str);
+@@ -146,10 +152,10 @@ case.
+ int str_icmp (s1, s2)
+ register char *s1, *s2;
+ {
+- for ( ; low_ch(*s1) == low_ch(*s2); s1++, s2++)
++ for ( ; low_ch((unsigned char)*s1) == low_ch((unsigned char)*s2); s1++, s2++)
+ if (*s1 == '\0')
+ return(0);
+- return(low_ch(*s1) - low_ch(*s2));
++ return(low_ch((unsigned char)*s1) - low_ch((unsigned char)*s2));
+ }
+
+ #ifdef NEED_MEMSET
@@ -220,6 +226,13 @@ BYTE data[];
((unsigned long) data[2] << 16) | ((unsigned long) data[3] << 24));
}
diff --git a/archivers/zoo/patches/patch-makelist.c b/archivers/zoo/patches/patch-makelist.c
new file mode 100644
index 00000000000..8e86616c424
--- /dev/null
+++ b/archivers/zoo/patches/patch-makelist.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-makelist.c,v 1.1 2014/06/29 03:24:33 dholland Exp $
+
+initialize uninitialized variable, found by gcc 4.5
+
+--- makelist.c~ 1991-07-16 15:52:17.000000000 +0000
++++ makelist.c
+@@ -53,7 +53,9 @@ int *longest; /* length of longes
+ #endif
+
+ int gap; /* for Shell sort */
+-
++
++ this_path = NULL;
++
+ flistsize--; /* allow for one terminating NULL entry */
+ fptr = *longest = 0;
+
diff --git a/archivers/zoo/patches/patch-mstime.i b/archivers/zoo/patches/patch-mstime.i
new file mode 100644
index 00000000000..a88282945f9
--- /dev/null
+++ b/archivers/zoo/patches/patch-mstime.i
@@ -0,0 +1,14 @@
+$NetBSD: patch-mstime.i,v 1.1 2014/06/29 03:24:33 dholland Exp $
+
+supply missing return type
+
+--- mstime.i~ 1991-07-16 15:53:11.000000000 +0000
++++ mstime.i
+@@ -12,6 +12,7 @@ static char mstimeid[]="@(#) mstime.i 2.
+ Function mstime() converts time in seconds since January 1 of BASEYEAR
+ to MS-DOS format date and time.
+ */
++void
+ mstime(longtime, date, time)
+ long longtime; /* input: seconds since Jan 1, BASEYEAR */
+ int *date, *time; /* output: MS-DOS format date and time */
diff --git a/archivers/zoo/patches/patch-zoo.c b/archivers/zoo/patches/patch-zoo.c
new file mode 100644
index 00000000000..e62282d5a8f
--- /dev/null
+++ b/archivers/zoo/patches/patch-zoo.c
@@ -0,0 +1,14 @@
+$NetBSD: patch-zoo.c,v 1.1 2014/06/29 03:24:33 dholland Exp $
+
+use standard headers
+
+--- zoo.c~ 1991-07-17 12:28:43.000000000 +0000
++++ zoo.c
+@@ -15,6 +15,7 @@ Copyright (C) 1986, 1987 Rahul Dhesi --
+ (C) Copyright 1988 Rahul Dhesi -- All rights reserved
+ (C) Copyright 1991 Rahul Dhesi -- All rights reserved
+ */
++#include <unistd.h>
+ #include "options.h"
+ #include "zooio.h"
+ #include "various.h"
diff --git a/archivers/zoo/patches/patch-zooadd.c b/archivers/zoo/patches/patch-zooadd.c
new file mode 100644
index 00000000000..7fbd1d16a5a
--- /dev/null
+++ b/archivers/zoo/patches/patch-zooadd.c
@@ -0,0 +1,14 @@
+$NetBSD: patch-zooadd.c,v 1.1 2014/06/29 03:24:33 dholland Exp $
+
+use standard headers
+
+--- zooadd.c~ 1993-05-01 03:43:38.000000000 +0000
++++ zooadd.c
+@@ -9,6 +9,7 @@ Copyright (C) 1986, 1987 Rahul Dhesi --
+ (C) Copyright 1988 Rahul Dhesi -- All rights reserved
+ (C) Copyright 1991 Rahul Dhesi -- All rights reserved
+ */
++#include <unistd.h>
+ #include "options.h"
+ /* Adds files specified in parameter-list to archive zoo_path. */
+
diff --git a/archivers/zoo/patches/patch-zoofilt.c b/archivers/zoo/patches/patch-zoofilt.c
new file mode 100644
index 00000000000..e491c23c834
--- /dev/null
+++ b/archivers/zoo/patches/patch-zoofilt.c
@@ -0,0 +1,27 @@
+$NetBSD: patch-zoofilt.c,v 1.1 2014/06/29 03:24:33 dholland Exp $
+
+- avoid implicit int
+- initialize uninitialized variable
+
+--- zoofilt.c~ 1991-07-16 15:59:09.000000000 +0000
++++ zoofilt.c
+@@ -34,15 +34,16 @@ int wrint PARMS((unsigned int)); /* writ
+ /* global variable used to pass two bytes (CRC value) back from lzd to here */
+ unsigned int filt_lzd_word;
+
++extern int lzc(), lzh_encode(); /* possible encoders */
++extern int lzd(), lzh_decode(); /* and decoders */
++
+ void zoofilt (option)
+ char *option;
+ {
+- int choice; /* what to do -- [de]compress */
++ int choice = 0; /* what to do -- [de]compress */
+ unsigned int filetag; /* tag stored in input */
+ int stat1, stat2, stat3; /* status codes */
+ int use_lzh = 0; /* use lzh instead */
+- extern lzc(), lzh_encode(); /* possible encoders */
+- extern lzd(), lzh_decode(); /* and decoders */
+
+ while (*++option) {
+ switch (*option) {