[packages/arc] - rel 3, add build fixes from fedora
baggins
baggins at pld-linux.org
Sun Feb 22 14:42:27 CET 2026
commit 6eae7e8c7166779c18092610cf2a092874c9fea5
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sun Feb 22 15:42:17 2026 +0100
- rel 3, add build fixes from fedora
aliasing-fix.patch | 26 ++
arc.spec | 24 +-
clarify-license.patch | 502 ++++++++++++++++++++++++++
compiler-warn.patch | 15 +
directory-traversel.patch | 21 ++
fcommon-fix.patch | 36 ++
fix-arcdie.patch | 34 ++
fix-function-prototypes.patch | 800 ++++++++++++++++++++++++++++++++++++++++++
glibc-2.43.patch | 213 +++++++++++
hdrv1-read-fix.patch | 70 ++++
manpage-section-fix.patch | 23 ++
spelling.patch | 16 +
12 files changed, 1779 insertions(+), 1 deletion(-)
---
diff --git a/arc.spec b/arc.spec
index b5d241a..2c07e7a 100644
--- a/arc.spec
+++ b/arc.spec
@@ -2,12 +2,23 @@ Summary: Arc archiver
Summary(pl.UTF-8): Archiwizer arc
Name: arc
Version: 5.21p
-Release: 2
+Release: 3
License: GPL v2
Group: Applications/Archiving
Source0: http://downloads.sourceforge.net/arc/%{name}-%{version}.tar.gz
# Source0-md5: 902ce24b23422880d474df6f1d9eba5e
Patch0: %{name}-time.patch
+Patch1: spelling.patch
+Patch2: manpage-section-fix.patch
+Patch3: clarify-license.patch
+Patch4: hdrv1-read-fix.patch
+Patch5: fix-arcdie.patch
+Patch6: directory-traversel.patch
+Patch7: compiler-warn.patch
+Patch8: fcommon-fix.patch
+Patch9: fix-function-prototypes.patch
+Patch10: aliasing-fix.patch
+Patch11: glibc-2.43.patch
URL: http://arc.sourceforge.net/
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -23,6 +34,17 @@ stare archiwa .arc.
%prep
%setup -q
%patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
+%patch -P4 -p1
+%patch -P5 -p1
+%patch -P6 -p1
+%patch -P7 -p1
+%patch -P8 -p1
+%patch -P9 -p1
+%patch -P10 -p1
+%patch -P11 -p1
%build
%{__make} \
diff --git a/aliasing-fix.patch b/aliasing-fix.patch
new file mode 100644
index 0000000..e1dcb62
--- /dev/null
+++ b/aliasing-fix.patch
@@ -0,0 +1,26 @@
+Stop sharing storage for 2 different (squeeze / unsqueeze) algorithms to
+avoid aliasing problems with LTO.
+diff -up arc-5.21p/arcsq.c~ arc-5.21p/arcsq.c
+--- arc-5.21p/arcsq.c~ 2025-10-19 15:50:55.000000000 +0200
++++ arc-5.21p/arcsq.c 2025-10-19 16:32:03.589839906 +0200
+@@ -43,7 +43,7 @@
+ * remaining nodes become the internal nodes of the final tree.
+ */
+
+-struct nd { /* shared by unsqueezer */
++static struct nd {
+ u_short weight; /* number of appearances */
+ short tdepth; /* length on longest path in tree */
+ short lchild, rchild; /* indices to next level */
+diff -up arc-5.21p/arcusq.c~ arc-5.21p/arcusq.c
+--- arc-5.21p/arcusq.c~ 2025-10-18 21:06:34.000000000 +0200
++++ arc-5.21p/arcusq.c 2025-10-19 16:32:54.965534041 +0200
+@@ -31,7 +31,7 @@
+ #define SPEOF 256 /* special endfile token */
+ #define NUMVALS 257 /* 256 data values plus SPEOF */
+
+-extern struct nd { /* decoding tree */
++static struct nd {
+ int child[2]; /* left, right */
+ } node[NUMVALS]; /* use large buffer */
+
diff --git a/clarify-license.patch b/clarify-license.patch
new file mode 100644
index 0000000..a62ab9e
--- /dev/null
+++ b/clarify-license.patch
@@ -0,0 +1,502 @@
+diff -up arc-5.21p/Arc521.doc~ arc-5.21p/Arc521.doc
+--- arc-5.21p/Arc521.doc~ 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/Arc521.doc 2013-04-03 15:07:43.759714829 +0200
+@@ -60,7 +60,8 @@ Associates, Inc. in October of 1986.
+ Section Page
+
+
+-Introduction .................................... 1
++License ......................................... 1
++Introduction .................................... 2
+ Using ARC ....................................... 3
+ ARC commands .................................... 5
+ Adding files ................................ 5
+@@ -81,7 +82,6 @@ MARC ..................................
+ ARCE ............................................ 20
+ Version numbers ................................. 21
+ Common questions and answers .................... 22
+-Maintenance contracts ........................... 24
+ Revision history ................................ 25
+ Changes in version 3 ........................ 25
+ Changes in version 4 ........................ 25
+@@ -94,7 +94,6 @@ Revision history ......................
+ Changes in version 5.2 ...................... 30
+ Program history and credits ..................... 31
+ Bulletin boards ................................. 33
+-Site licenses ................................... 34
+
+
+
+@@ -108,80 +107,65 @@ Site licenses .........................
+
+
+
+-
INTRODUCTION
++
++
LICENSE
++
++
++
++ARC is Free Software distributed under the terms of the GNU General Public
++License (See COPYING for license details).
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
+
+
+
+-ARC is the copyrighted property of System Enhancement
+-Associates, Inc. You are granted a limited license to
+-use ARC, and to copy it and distribute it, provided
+-that the following conditions are met:
+-
+-1) No fee may be charged for such copying and
+- distribution.
+-
+-2) ARC may ONLY be distributed in its original,
+- unmodified state.
+-
+-3) ARC may *not* be distributed, in whole or in part, as
+- part of any commercial product or service without
+- the express written permission of System
+- Enhancement Associates.
+-
+-
+-Contributions for the use of this program will be
+-appreciated, and should be sent to:
+-
+- System Enhancement Associates, Inc.
+- 21 New Street, Wayne NJ 07470
+-
+-You may not use this product in a commercial
+-environment or a governmental organization without
+-paying a license fee of $35. Site licenses and
+-commercial distribution licenses are available. A
+-program disk and printed documentation are available
+-for $50. See the order form enclosed with this manual
+-for more details.
+
+
+
+-ARC is user supported software. This means that you
+-may copy it freely and give the copies away to anyone
+-you wish, at no cost. They are in turn requested to
+-send in a contribution if they decide to use it.
+-
+-The user supported software concept (often referred to
+-as "shareware") is an attempt to provide software at low
+-cost. The cost of offering a new product by
+-conventional means is staggering, and hence dissuades
+-many independent authors and small companies from
+-developing and promoting their ideas. User supported
+-software is an attempt to develop a new marketing
+-channel, where products can be introduced at low cost.
+
+
+
+
+-ARC Page 1
+-
If user supported software works, then everyone will
+-benefit. The user will benefit by receiving quality
+-products at low cost, and by being able to "test
+-drive" software thoroughly before purchasing it. The
+-author benefits by being able to enter the commercial
+-software arena without first needing large sources of
+-venture capital.
+-
+-But it can only work with your support. We're not
+-just talking about ARC here, but about all user
+-supported software. If you obtain a user supported
+-program from a friend or colleague, and are still
+-using it after a couple of weeks, then it is obviously
+-worth something to you, and a contribution should be
+-sent.
+
+
+
+-And now, back to ARC:
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++ARC Page 1
++
INTRODUCTION
++
++
+
+ ARC is used to create and maintain file archives. An
+ archive is a group of files collected together into
+@@ -217,6 +201,22 @@ never be larger than the original file.
+
+
+
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
+ ARC Page 2
+
USING ARC
+
+@@ -1196,14 +1196,14 @@ If you run ARCE with no arguments at all
+ give you a brief reminder of how to use it.
+
+
+-NOTICE:
NOTICE: ARCE is the copyrighted property of Vernon D.
+- Buerg and Wayne Chin. It is included on the
+- ARC program disk as a service to ARC users.
+-
+- Vernon D. Buerg
+- 456 Lakeshire Drive
+- Daly City, CA 94015
+- RBBS: (415) 994-2944
++NOTICE: ARCE is not Free Software, and thus is not included with this version
++of ARC.
++
++
++
++
++
++
+
+
+
+@@ -1303,13 +1303,7 @@ A: ARC.EXE. One or more people have bee
+ worth the extra step in development in this case.
+
+
+-Q: How can I get the latest version of ARC?
+
+-A: ARC updates are distributed through normal
+- shareware channels, and by FidoNet. We also ship a
+- program update disk on every order of $50 or more.
+- Also, please refer to the next section for
+- information about our maintenance contracts.
+
+
+
+@@ -1317,32 +1311,14 @@ A: ARC updates are distributed through n
+
+
+
+-ARC Page 22
+-
Q: Can I use ARC to distribute my public domain or
+- shareware program?
+
+-A: Yes, of course.
+
+
+-Q: Can I use ARC to distribute my commercial software
+- package?
+
+-A: Yes, provided that you obtain a commercial
+- distribution license from us. Please contact us
+- for details.
+-
+-
+-Q: I'm a commercial user. Why should I pay for
+- shareware that others get for free?
+-
+-A: Because you cannot credibly plead poverty.
+- ___
Shareware, all shareware, is an attempt to develop
+- a new marketing channel to the benefit of everyone.
+- You can still "test drive" shareware for a short
+- period, but if you decide to use it in your
+- business, then you should pay for it.
+
+
++ARC Page 22
++
+ Q: Why not allow me to select which method of
+ compression I want ARC to use?
+
+@@ -1372,18 +1348,42 @@ A: It would needlessly complicate ARC, b
+
+
+
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
+ ARC Page 23
+-
MAINTENANCE CONTRACTS
++
++
++
++
++
++
++
+
+
+
+-Registered users of ARC receive 90 days of telephone
+-support at no extra charge. If you wish, you can
+-extend this by pruchasing a maintenance contract.
+
+-A maintenance contract costs $50 per year and entitles
+-you to unlimited telephone support, as well as free
+-updates to ARC as they come out.
+
+
+
+@@ -1923,178 +1923,3 @@ distribute ARC.
+
+
+ ARC Page 33
+-
SITE LICENSES
+-
+-
+-
+-Corporate users may wish to obtain a site license for
+-the use of ARC. Please use the order form in this
+-manual to order a site license. Site licenses are
+-granted as of when we receive your payment. License
+-fees vary depending on the number of computers on
+-which ARC will be used, as follows:
+-
+- 1 to 9 machines $35 each
+- 10 to 24 machines $25 each
+- 25 to 49 machines $20 each
+- 50 to 99 machines $15 each
+- over 99 machines $1500 one time fee
+-
+-
+-
+-Enclosed is a site license agreement, which should be
+-signed and sent with your payment when ordering a
+-commercial site license.
+-
+-
+-A commercial site license does not include additional
+-copies of the ARC program disk and the ARC manual.
+-Instead, you make your own copies of the disk and
+-manual as you need them. If you wish, you can order
+-additional program disks and manuals from us.
+-
+-Additional program disks cost $10 each. Additional
+-manuals cost $20 each. If you wish, you can order
+-program sets for $40 each. A "program set" is a
+-program disk and manual enclosed in a vinyl binder.
+-There is a $50 minimum on all orders.
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-ARC Page 34
+-
SITE LICENSE APPLICATION
+-
+-
+-
+-The use of ARC in a commercial environment or government organization
+-is granted under the following terms:
+-
+-1. Payment of the license fee must be made to System Enhancement
+- Associates, Inc. The fee is based on the number of computers
+- which will be used to run ARC, as follows:
+-
+- 1 to 9 machines $35 each
+- 10 to 24 machines $25 each
+- 25 to 49 machines $20 each
+- 50 to 99 machines $15 each
+- over 99 machines $1500 one time fee
+-
+-2. You may use ARC on the number of computers included in the license
+- fee. If you have paid the fee for over 99 machines, then you may
+- use ARC on any number of computers within your organization.
+-
+-3. You may make copies of the program and documentation, in their
+- original, unmodified form, without restriction. You may
+- distribute these copies without restriction.
+-
+-4. If these copies are distributed outside of your organization, you
+- have no obligation to control the use of those copies which are
+- outside of your organization.
+-
+-5. You may make copies of the program documentation, in both its
+- printed form and machine readable form, without restriction.
+-
+-6. You may use all future versions of ARC under this license.
+-
+-7. You may *not* modify the program or charge a fee for copying or
+- distributing the program or its documentation.
+-
+-8. It is your responsibility to make the necessary copies and to
+- deliver them to the computers which they will be used on. If you
+- wish, you can order additional ARC program disks and manuals.
+-
+-9. We are not responsible for *anything* that may happen or not happen
+- if you use ARC. You're on your own.
+-
+-
+- I agree to abide by the terms and conditions of this license.
+-
+- _____________________________ __________________________
+- Signature Date
+-
+- _____________________________
+- Name (please print or type)
+-
+- _____________________________
+- Title
+-
+- _____________________________
+- Company
+-
+-
+-
ORDER FORM
+-
+-
+-
+-Check which items you wish to purchase:
+-
+- [] Noncommercial license for the use of ARC.
+-
+- [] Commercial license for the use of ARC on ___ computers (see
+- attached price schedule and terms).
+-
+- [] Program disk and documentation (only on orders of $50 or more,
+- not counting maintenance contracts).
+-
+- [] ____ additional program disks at $10 per disk.
+-
+- [] ____ additional manuals at $20 per manual
+-
+- [] ____ additional program sets (disk, manual, and binder) at $40
+- per program set.
+-
+- [] One year maintenance agreement at $50 per year.
+-
+- [] Payment of $_____ is enclosed (check or money order).
+-
+- [] Please charge $_____ to my [] Visa or [] MasterCard:
+-
+- Card number: _______________________________
+-
+- Expiration date: ___________________________
+-
+- Signature: _________________________________
+-
+- _______________________________________________
+- Name
+-
+- _______________________________________________
+-
+-
+- _______________________________________________
+- Address
+-
+- ______________________ ________ ____________
+- City State Zip
+-
+- _______/_______
+- FidoNet address
+-
+-
+-Send this completed form to:
+-
+- System Enhancement Associates, Inc.
+- 21 New Street, Wayne NJ 07470
+-
+-For program disk orders outside the U.S., please add an additional $5,
+-and enclose an international money order payable in U.S. currency.
+-
+-For commercial site license orders, please enclose a signed copy of
+-the site license agreement.
+-
+diff -up arc-5.21p/Readme~ arc-5.21p/Readme
+--- arc-5.21p/Readme~ 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/Readme 2013-04-03 14:45:24.840611200 +0200
+@@ -89,12 +89,12 @@ the programs behave indentically. Note t
+ ARC520.DOC - the differences between the two versions are described in
+ the file CHANGES.521.
+
+-Oh yeah - this program may be distributed freely so long as you don't
+-modify it in any way. You may not charge for distributing it. (Don't
+-feel bad, I can't charge for it either. }-) It'd be nice if you kept
+-this and the other enclosed doc files with it when distributing, but
+-I'm not going to make a fuss about it. Most people are so familiar
+-with the program by now that it wouldn't matter much anyway. You
++Oh yeah - this program may be distributed freely under the terms of
++the GNU General Public License (See COPYING for license details).
++
++It'd be nice if you kept this and the other enclosed doc files with it when
++distributing, but I'm not going to make a fuss about it. Most people are so
++familiar with the program by now that it wouldn't matter much anyway. You
+ should keep this README file around, so bug reports & such will find
+ their way back to me. (Bugs? What bugs? Nah, there aren't any bugs...)
+
diff --git a/compiler-warn.patch b/compiler-warn.patch
new file mode 100644
index 0000000..6d983ab
--- /dev/null
+++ b/compiler-warn.patch
@@ -0,0 +1,15 @@
+diff -up arc-5.21p/marc.c~ arc-5.21p/marc.c
+--- arc-5.21p/marc.c~ 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/marc.c 2020-02-15 10:25:26.466829619 +0100
+@@ -297,9 +297,9 @@ struct heads *hdr; /* storage fo
+ char *i = hdr->name; /* string index */
+ int n; /* index */
+
+- for(n=0; n<FNLEN; n++) /* fill name field */
++ for(n=0; n<(FNLEN-1); n++) /* fill name field */
+ *i++ = 0176; /* impossible high value */
+- *--i = '\0'; /* properly end the name */
++ *i++ = '\0'; /* properly end the name */
+
+ hdrver = 0; /* reset header version */
+ if(readhdr(hdr,f)) /* use normal reading logic */
diff --git a/directory-traversel.patch b/directory-traversel.patch
new file mode 100644
index 0000000..b55e153
--- /dev/null
+++ b/directory-traversel.patch
@@ -0,0 +1,21 @@
+Fix directory traversal bugs
+
+arc archives do not contain directory hierarchies, only filenames, so refuse
+to operate on archives which have the directory-seperator inside filenames.
+
+BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774527
+BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1179143
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+diff -up arc-5.21p/arcio.c~ arc-5.21p/arcio.c
+--- arc-5.21p/arcio.c~ 2015-01-16 13:04:16.000000000 +0100
++++ arc-5.21p/arcio.c 2015-01-16 15:45:31.389010626 +0100
+@@ -109,6 +109,9 @@ readhdr(hdr, f) /* read a header from
+ #if _MTS
+ (void) atoe(hdr->name, strlen(hdr->name));
+ #endif
++ if (strchr(hdr->name, CUTOFF) != NULL)
++ arcdie("%s contains illegal filename %s", arcname, hdr->name);
++
+ for (i = 0, hdr->size=0; i<4; hdr->size<<=8, hdr->size += dummy[16-i], i++);
+ hdr->date = (short) ((dummy[18] << 8) + dummy[17]);
+ hdr->time = (short) ((dummy[20] << 8) + dummy[19]);
diff --git a/fcommon-fix.patch b/fcommon-fix.patch
new file mode 100644
index 0000000..2a420ac
--- /dev/null
+++ b/fcommon-fix.patch
@@ -0,0 +1,36 @@
+diff -up arc-5.21p/arclzw.c~ arc-5.21p/arclzw.c
+--- arc-5.21p/arclzw.c~ 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arclzw.c 2020-02-15 10:34:25.469210421 +0100
+@@ -57,9 +57,10 @@ static VOID putcode();
+ #define NOT_FND 0xFFFF
+
+ extern u_char *pinbuf;
++extern u_char *outend;
++extern u_char *outbuf;
+ u_char *inbeg, *inend;
+-u_char *outbuf;
+-u_char *outbeg, *outend;
++u_char *outbeg;
+
+ static int sp; /* current stack pointer */
+ static int inflag;
+diff -up arc-5.21p/arcunp.c~ arc-5.21p/arcunp.c
+--- arc-5.21p/arcunp.c~ 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcunp.c 2020-02-15 10:33:15.751795541 +0100
+@@ -33,14 +33,14 @@ VOID arcdie(), codebuf();
+
+ extern u_char state; /* repeat unpacking state */
+ extern int lastc;
++extern short crcval; /* CRC check value */
++extern long stdlen; /* bytes to read */
+
+ /* repeat unpacking states */
+
+ #define NOHIST 0 /* no relevant history */
+ #define INREP 1 /* sending a repeated value */
+
+-short crcval; /* CRC check value */
+-long stdlen; /* bytes to read */
+ #if !DOS
+ static int gotcr; /* got a carriage return? */
+ #endif
diff --git a/fix-arcdie.patch b/fix-arcdie.patch
new file mode 100644
index 0000000..03fa9de
--- /dev/null
+++ b/fix-arcdie.patch
@@ -0,0 +1,34 @@
+Fix arcdie crash when called with more then 1 variable argument
+
+Add proper vararg handling to fix crash on 64 bit machines when arcdie gets
+called with more then 1 variable argument.
+
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+diff -up arc-5.21p/arcmisc.c~ arc-5.21p/arcmisc.c
+--- arc-5.21p/arcmisc.c~ 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcmisc.c 2015-01-16 16:10:29.322603290 +0100
+@@ -4,6 +4,7 @@
+ */
+
+ #include <stdio.h>
++#include <stdarg.h>
+ #include <ctype.h>
+ #include "arc.h"
+
+@@ -223,11 +224,13 @@ upper(string)
+ }
+ /* VARARGS1 */
+ VOID
+-arcdie(s, arg1, arg2, arg3)
+- char *s;
++arcdie(const char *s, ...)
+ {
++ va_list args;
+ fprintf(stderr, "ARC: ");
+- fprintf(stderr, s, arg1, arg2, arg3);
++ va_start(args, s);
++ vfprintf(stderr, s, args);
++ va_end(args);
+ fprintf(stderr, "\n");
+ #if UNIX
+ perror("UNIX");
diff --git a/fix-function-prototypes.patch b/fix-function-prototypes.patch
new file mode 100644
index 0000000..6150e54
--- /dev/null
+++ b/fix-function-prototypes.patch
@@ -0,0 +1,800 @@
+diff -ur arc-5.21p.orig/Makefile arc-5.21p/Makefile
+--- arc-5.21p.orig/Makefile 2025-10-19 16:12:03.122159356 +0200
++++ arc-5.21p/Makefile 2025-10-18 21:10:36.667084240 +0200
+@@ -44,7 +44,7 @@
+ OPT = -O -Wall
+ # For MWC 3.0 on the Atari ST, use:
+ #CFLAGS = -VCOMPAC -VPEEP
+-CFLAGS = $(OPT) $(SYSTEM)
++CFLAGS = $(OPT) $(SYSTEM) -Wno-old-style-definition -Wno-pointer-sign -Wno-unused-but-set-variable
+
+ # GNU's gcc is very nice, if you've got it. Otherwise just cc.
+ #CC = cgcc -mshort -mbaserel
+diff -ur arc-5.21p.orig/arc.c arc-5.21p/arc.c
+--- arc-5.21p.orig/arc.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arc.c 2025-10-18 21:21:13.755468945 +0200
+@@ -72,6 +72,7 @@
+ */
+ #include <stdio.h>
+ #include "arc.h"
++#include "proto.h"
+
+ #if UNIX
+ #include <sys/types.h>
+@@ -89,16 +90,13 @@
+ char *calloc(), *malloc(), *realloc();
+ #endif
+
+-VOID addarc(), delarc(), extarc(), lstarc(), tstarc(), cvtarc(), runarc();
+-VOID arcdie();
+-static VOID expandlst();
++static VOID expandlst(int n);
+ #if _MTS
+ VOID etoa();
+ #endif
+ #if GEMDOS
+ long _stksize = 30720;
+ #endif
+-char *makefnam(); /* filename fixup routine */
+
+ /* Block I/O buffers */
+
+@@ -114,8 +112,6 @@
+ {
+ char opt = 0;/* selected action */
+ char *a; /* option pointer */
+- VOID upper();/* case conversion routine */
+- char *envfind(); /* environment searcher */
+ int n; /* index */
+ char *arctemp2;
+ #if GEMDOS
+@@ -434,7 +430,7 @@
+ expandlst(n) /* expand an indirect reference */
+ int n; /* number of entry to expand */
+ {
+- FILE *lf, *fopen(); /* list file, opener */
++ FILE *lf; /* list file, opener */
+ char buf[100]; /* input buffer */
+ int x; /* index */
+ char *p = lst[n] + 1; /* filename pointer */
+diff -ur arc-5.21p.orig/arcadd.c arc-5.21p/arcadd.c
+--- arc-5.21p.orig/arcadd.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcadd.c 2025-10-18 22:05:28.275420999 +0200
+@@ -17,6 +17,7 @@
+ */
+ #include <stdio.h>
+ #include "arc.h"
++#include "proto.h"
+ #if _MTS
+ #include <mts.h>
+ #include <ctype.h>
+@@ -26,13 +27,14 @@
+ #include <strings.h>
+ #endif
+
+-static int addfile();
+-int readhdr(), unlink();
+-#if UNIX
+-int izadir();
+-#endif
+-VOID writehdr(), filecopy(), getstamp();
+-VOID pack(), closearc(), openarc(), arcdie();
++static int addfile(char *path, char *name, int update, int fresh);
++static int addbunch(
++ int nfiles, /* number of files to add */
++ char **path, /* pointers to pathnames */
++ char **name, /* pointers to filenames */
++ int move, /* true if moving file */
++ int update, /* true if updating */
++ int fresh); /* true if freshening */
+
+ #ifndef __STDC__
+ char *malloc(), *realloc(); /* memory allocators */
+@@ -49,7 +51,7 @@
+ int update; /* true if updating */
+ int fresh; /* true if freshening */
+ {
+- char *d, *dir(); /* directory junk */
++ char *d; /* directory junk */
+ char buf[STRLEN]; /* pathname buffer */
+ char **path; /* pointer to pointers to paths */
+ char **name; /* pointer to pointers to names */
+@@ -61,7 +63,6 @@
+ #if MSDOS
+ unsigned int coreleft(); /* remaining memory reporter */
+ #endif
+- int addbunch();
+
+ if (num < 1) { /* if no files named */
+ num = 1; /* then fake one */
+@@ -137,7 +138,7 @@
+ printf("No files were added.\n");
+ }
+
+-int
++static int
+ addbunch(nfiles, path, name, move, update, fresh) /* add a bunch of files */
+ int nfiles; /* number of files to add */
+ char **path; /* pointers to pathnames */
+@@ -245,8 +246,8 @@
+ {
+ struct heads nhdr; /* data regarding the new file */
+ struct heads ohdr; /* data regarding an old file */
+- FILE *f, *fopen(); /* file to add, opener */
+- long starts, ftell(); /* file locations */
++ FILE *f; /* file to add, opener */
++ long starts; /* file locations */
+ int upd = 0;/* true if replacing an entry */
+
+ #if !_MTS
+diff -ur arc-5.21p.orig/arccode.c arc-5.21p/arccode.c
+--- arc-5.21p.orig/arccode.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arccode.c 2025-10-18 21:32:16.051710612 +0200
+@@ -21,6 +21,7 @@
+ */
+ #include <stdio.h>
+ #include "arc.h"
++#include "proto.h"
+
+ static char *p; /* password pointer */
+
+diff -ur arc-5.21p.orig/arccvt.c arc-5.21p/arccvt.c
+--- arc-5.21p.orig/arccvt.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arccvt.c 2025-10-18 22:39:59.043695143 +0200
+@@ -21,11 +21,9 @@
+ #include <mts.h>
+ #endif
+ #include "arc.h"
++#include "proto.h"
+
+-int match(), readhdr(), unpack(), unlink();
+-VOID openarc(), rempath(), closearc(), arcdie(), pack();
+-VOID writehdr(), filecopy();
+-static VOID cvtfile();
++static VOID cvtfile(struct heads *hdr);
+
+ static char tempname[STRLEN]; /* temp file name */
+
+@@ -38,8 +36,6 @@
+ int cvt; /* true to convert current file */
+ int did[MAXARG];/* true when argument was used */
+ int n; /* index */
+- char *makefnam(); /* filename fixer */
+- FILE *fopen();/* file opener */
+
+ if (arctemp) /* use temp area if specified */
+ sprintf(tempname, "%s.CVT", arctemp);
+@@ -96,8 +92,8 @@
+ cvtfile(hdr) /* convert a file */
+ struct heads *hdr; /* pointer to header data */
+ {
+- long starts, ftell(); /* where the file goes */
+- FILE *tmp, *fopen(); /* temporary file */
++ long starts; /* where the file goes */
++ FILE *tmp; /* temporary file */
+
+ if (!(tmp = fopen(tempname, "w+b")))
+ arcdie("Unable to create temporary file %s", tempname);
+diff -ur arc-5.21p.orig/arcdata.c arc-5.21p/arcdata.c
+--- arc-5.21p.orig/arcdata.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcdata.c 2025-10-18 21:32:16.859706027 +0200
+@@ -22,6 +22,7 @@
+
+ #define DONT_DEFINE
+ #include "arc.h"
++#include "proto.h"
+
+ int keepbak = 0; /* true if saving the old archive */
+ #if UNIX
+diff -ur arc-5.21p.orig/arcdel.c arc-5.21p/arcdel.c
+--- arc-5.21p.orig/arcdel.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcdel.c 2025-10-18 22:20:02.153472616 +0200
+@@ -18,9 +18,7 @@
+ */
+ #include <stdio.h>
+ #include "arc.h"
+-
+-VOID arcdie(), rempath(), openarc(), closearc(), writehdr(), filecopy();
+-int match(), readhdr();
++#include "proto.h"
+
+ VOID
+ delarc(num, arg) /* remove files from archive */
+diff -ur arc-5.21p.orig/arcdos.c arc-5.21p/arcdos.c
+--- arc-5.21p.orig/arcdos.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcdos.c 2025-10-18 22:55:12.433513243 +0200
+@@ -22,6 +22,7 @@
+ */
+ #include <stdio.h>
+ #include "arc.h"
++#include "proto.h"
+
+ #if MSDOS
+ #include "fileio2.h" /* needed for filehand */
+@@ -84,7 +86,7 @@
+ #endif
+ #if UNIX
+ struct stat buf;
+- struct tm *localtime(), *t;
++ struct tm *t;
+
+ fstat(fileno(f), &buf);
+ t=localtime(&(buf.st_mtime));
+@@ -174,8 +176,6 @@
+ #if UNIX
+ struct tm tm;
+ struct timeval tvp[2];
+- int utimes();
+- long tmclock();
+ tm.tm_sec = (time & 31) * 2;
+ tm.tm_min = (time >> 5) & 63;
+ tm.tm_hour = (time >> 11);
+diff -ur arc-5.21p.orig/arcext.c arc-5.21p/arcext.c
+--- arc-5.21p.orig/arcext.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcext.c 2025-10-18 22:40:09.363636711 +0200
+@@ -18,6 +18,7 @@
+ */
+ #include <stdio.h>
+ #include "arc.h"
++#include "proto.h"
+ #if !MSDOS
+ #include <ctype.h>
+ #endif
+@@ -26,9 +27,7 @@
+ #include <strings.h>
+ #endif
+
+-VOID openarc(), closearc(), setstamp();
+-int match(), readhdr(), unpack();
+-static VOID extfile();
++static VOID extfile(struct heads *hdr, char *path, int prt);
+
+ #ifndef __STDC__
+ char *malloc();
+@@ -113,7 +112,7 @@
+ char *path; /* pointer to path name */
+ int prt; /* true if printing */
+ {
+- FILE *f, *fopen(); /* extracted file, opener */
++ FILE *f; /* extracted file, opener */
+ char buf[STRLEN]; /* input buffer */
+ char fix[STRLEN]; /* fixed name buffer */
+ char *i; /* string index */
+diff -ur arc-5.21p.orig/arcio.c arc-5.21p/arcio.c
+--- arc-5.21p.orig/arcio.c 2025-10-19 16:12:03.098719682 +0200
++++ arc-5.21p/arcio.c 2025-10-18 22:57:08.063851854 +0200
+@@ -19,13 +19,12 @@
+ */
+ #include <stdio.h>
+ #include "arc.h"
++#include "proto.h"
+ #if _MTS
+ #include <mts.h>
+ #endif
+ #include <string.h>
+
+-VOID arcdie();
+-
+ int
+ readhdr(hdr, f) /* read a header from an archive */
+ struct heads *hdr; /* storage for header */
+diff -ur arc-5.21p.orig/arclst.c arc-5.21p/arclst.c
+--- arc-5.21p.orig/arclst.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arclst.c 2025-10-18 22:21:17.472046158 +0200
+@@ -19,10 +19,9 @@
+ */
+ #include <stdio.h>
+ #include "arc.h"
++#include "proto.h"
+
+-VOID rempath(), openarc(), closearc();
+-int readhdr(), match();
+-static VOID lstfile();
++static VOID lstfile(struct heads *hdr);
+
+ VOID
+ lstarc(num, arg) /* list files in archive */
+diff -ur arc-5.21p.orig/arclzw.c arc-5.21p/arclzw.c
+--- arc-5.21p.orig/arclzw.c 2025-10-19 16:12:03.120397967 +0200
++++ arc-5.21p/arclzw.c 2025-10-18 23:05:46.385871818 +0200
+@@ -33,8 +33,8 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include "arc.h"
++#include "proto.h"
+
+-VOID arcdie();
+ #if MSDOS
+ char *setmem();
+ #else
+@@ -46,7 +46,9 @@
+ #endif
+
+ #include "proto.h"
+-static VOID putcode();
++static VOID putcode(int code, FILE *t);
++static VOID upd_tab(u_short pred, u_short foll);
++
+ /* definitions for older style crunching */
+
+ #define FALSE 0
+@@ -136,7 +138,6 @@
+ static int clear_flg;
+ static long ratio;
+ static long checkpoint;
+-VOID upd_tab();
+
+ /*
+ * the next two codes should not be changed lightly, as they must not lie
+@@ -631,12 +632,9 @@
+ * release of a developmental copy forces us to leave this in.
+ */
+
+-static u_short(*h) (); /* pointer to hash function */
++static u_short(*h) (u_short pred, u_char foll); /* pointer to hash function */
+
+-static u_short
+-oldh(pred, foll) /* old hash function */
+- u_short pred; /* code for preceeding string */
+- u_char foll; /* value of following char */
++static u_short oldh(u_short pred, u_char foll)
+ {
+ long local; /* local hash value */
+
+@@ -645,10 +643,7 @@
+ return (local >> 6) & 0x0FFF; /* return the middle 12 bits */
+ }
+
+-static u_short
+-newh(pred, foll) /* new hash function */
+- u_short pred; /* code for preceeding string */
+- u_char foll; /* value of following char */
++static u_short newh(u_short pred, u_char foll)
+ {
+ return (((pred + foll) & 0xFFFF) * 15073) & 0xFFF; /* faster hash */
+ }
+@@ -744,7 +739,7 @@
+ * room. This must be done elsewhere.
+ */
+
+-VOID
++static VOID
+ upd_tab(pred, foll) /* add an entry to the table */
+ u_short pred; /* code for preceeding string */
+ u_short foll; /* character which follows string */
+diff -ur arc-5.21p.orig/arcmatch.c arc-5.21p/arcmatch.c
+--- arc-5.21p.orig/arcmatch.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcmatch.c 2025-10-19 16:03:20.882197379 +0200
+@@ -18,14 +18,13 @@
+ */
+ #include <stdio.h>
+ #include "arc.h"
++#include "proto.h"
+
+ #include <string.h>
+ #if BSD
+ #include <strings.h>
+ #endif
+
+-VOID arcdie();
+-
+ int
+ match(n, t) /* test name against template */
+ char *n; /* name to test */
+diff -ur arc-5.21p.orig/arcmisc.c arc-5.21p/arcmisc.c
+--- arc-5.21p.orig/arcmisc.c 2025-10-19 16:12:03.088040414 +0200
++++ arc-5.21p/arcmisc.c 2025-10-19 16:05:06.777553057 +0200
+@@ -6,7 +6,9 @@
+ #include <stdio.h>
+ #include <stdarg.h>
+ #include <ctype.h>
++#include <unistd.h>
+ #include "arc.h"
++#include "proto.h"
+
+ #include <string.h>
+ #if BSD
+@@ -67,7 +69,6 @@
+ #define DIRECT direct
+ #endif
+ #include <sys/stat.h>
+- int rename(), unlink();
+ #include <fcntl.h>
+ #endif
+
+@@ -92,7 +93,8 @@
+ int free();
+ #endif
+ #endif
+-int match();
++
++static int fmatch(const struct DIRECT *direntry);
+
+ /* Safe open for temp files */
+ FILE *
+@@ -109,11 +111,10 @@
+ move(oldnam, newnam)
+ char *oldnam, *newnam;
+ {
+- FILE *fopen(), *old, *new;
++ FILE *old, *new;
+ #if !_MTS
+ struct stat oldstat;
+ #endif
+- VOID filecopy();
+ #if GEMDOS
+ if (Frename(0, oldnam, newnam))
+ #else
+@@ -248,7 +249,6 @@
+ char *dirname;
+
+ {
+- char *getcwd();
+ #if GEMDOS
+ int drv;
+ char *buf;
+@@ -311,11 +311,6 @@
+ static struct DIRECT **namelist;
+ static char **NameList;
+ static char namecopy[STRLEN], *dirname;
+-#if UNIX
+- int alphasort();
+- int scandir();
+-#endif /* UNIX */
+- int fmatch();
+ static int Nnum = 0, ii;
+
+
+@@ -353,10 +348,7 @@
+ /*
+ * Filename match - here, * matches everything
+ */
+-
+-int
+-fmatch(direntry)
+- struct DIRECT *direntry;
++static int fmatch(const struct DIRECT *direntry)
+ {
+ char *string;
+
+diff -ur arc-5.21p.orig/arcpack.c arc-5.21p/arcpack.c
+--- arc-5.21p.orig/arcpack.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcpack.c 2025-10-18 23:15:56.674269351 +0200
+@@ -25,10 +25,8 @@
+
+ #include "proto.h"
+
+-VOID setcode(), init_cm(), codebuf();
+-VOID arcdie(), init_sq(), flsh_cm();
+-int crcbuf();
+-u_int ncr_buf();
++static u_int ncr_buf(u_int inbytes);
++static u_int getbuf(FILE *f);
+
+ int lastc;
+
+@@ -59,9 +57,7 @@
+ long ncrlen; /* length after packing */
+ long huflen; /* length after squeezing */
+ long lzwlen; /* length after crunching */
+- long pred_sq(), head_sq(), huf_buf(); /* stuff for squeezing */
+- long pred_cm(); /* dynamic crunching cleanup */
+- long tloc, ftell(); /* start of output */
++ long tloc; /* start of output */
+ u_int inbytes = 0, pakbytes = 0;
+
+ /* first pass - see which method is best */
+@@ -195,7 +191,7 @@
+ * repeat marker.
+ */
+
+-u_int
++static u_int
+ ncr_buf(inbytes)
+ u_int inbytes; /* number of bytes in inbuf */
+ {
+@@ -243,7 +239,7 @@
+ return (pakptr - pakbuf);
+ }
+
+-u_int
++static u_int
+ getbuf(f)
+ FILE *f;
+ {
+diff -ur arc-5.21p.orig/arcrun.c arc-5.21p/arcrun.c
+--- arc-5.21p.orig/arcrun.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcrun.c 2025-10-18 23:17:35.145684866 +0200
+@@ -21,15 +21,13 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "arc.h"
++#include "proto.h"
+ #if UNIX
+ #include <unistd.h>
+ #include <sys/stat.h>
+ #endif
+
+-VOID rempath(), openarc(), closearc(), arcdie();
+-int readhdr(), match(), unpack();
+-static VOID runfile();
+-FILE *tmpopen();
++static VOID runfile(struct heads *hdr, int num, char *arg[]);
+
+ VOID
+ runarc(num, arg) /* run file from archive */
+@@ -37,9 +35,7 @@
+ char *arg[]; /* pointers to arguments */
+ {
+ struct heads hdr; /* file header */
+- char *makefnam(); /* filename fixer */
+ char buf[STRLEN]; /* filename buffer */
+- FILE *fopen();/* file opener */
+ char *dummy[2];
+
+ dummy[0]="dummy";
+@@ -68,8 +64,8 @@
+ int num; /* number of arguments */
+ char *arg[]; /* pointers to arguments */
+ {
+- FILE *tmp, *fopen(); /* temporary file */
+- char buf[STRLEN], *makefnam(); /* temp file name, fixer */
++ FILE *tmp; /* temporary file */
++ char buf[STRLEN]; /* temp file name, fixer */
+ #if DOS
+ char nbuf[64], *i, *rindex();
+ #endif
+diff -ur arc-5.21p.orig/arcsq.c arc-5.21p/arcsq.c
+--- arc-5.21p.orig/arcsq.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcsq.c 2025-10-19 15:50:55.427704503 +0200
+@@ -67,8 +67,13 @@
+ static int cbitsrem; /* # of code string bits left */
+ static u_short ccode; /* current code right justified */
+
+-static VOID scale(), heap(), adjust(), bld_tree(), init_enc();
+-static int cmptrees(), buildenc();
++static VOID scale(u_short ceil);
++static VOID heap(int list[], int length);
++static VOID adjust(int list[], int top, int bottom);
++static VOID bld_tree(int list[], int len);
++static VOID init_enc(VOID);
++static int buildenc(int level, int root);
++static int cmptrees(int a, int b);
+
+ extern u_char *outbuf, *outbeg, *outend;
+
+diff -ur arc-5.21p.orig/arcsvc.c arc-5.21p/arcsvc.c
+--- arc-5.21p.orig/arcsvc.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcsvc.c 2025-10-19 15:51:27.963508443 +0200
+@@ -20,6 +20,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#include <unistd.h>
+ #include "arc.h"
+ #if _MTS
+ #include <mts.h>
+@@ -27,15 +28,10 @@
+
+ #include "proto.h"
+
+-VOID arcdie(), setstamp();
+-int unlink();
+-
+ VOID
+ openarc(chg) /* open archive */
+ int chg; /* true to open for changes */
+ {
+- FILE *fopen();/* file opener */
+-
+ if (!(arc = fopen(arcname, OPEN_R))) {
+ if (chg) {
+ if (note)
+diff -ur arc-5.21p.orig/arctst.c arc-5.21p/arctst.c
+--- arc-5.21p.orig/arctst.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arctst.c 2025-10-18 22:40:43.659442504 +0200
+@@ -17,15 +17,13 @@
+ */
+ #include <stdio.h>
+ #include "arc.h"
+-
+-VOID openarc();
+-int readhdr(), unpack();
++#include "proto.h"
+
+ VOID
+-tstarc()
++tstarc(void)
+ { /* test integrity of an archive */
+ struct heads hdr; /* file header */
+- long arcsize, ftell(); /* archive size */
++ long arcsize; /* archive size */
+
+ openarc(0); /* open archive for reading */
+ fseek(arc, 0L, 2); /* move to end of archive */
+diff -ur arc-5.21p.orig/arcunp.c arc-5.21p/arcunp.c
+--- arc-5.21p.orig/arcunp.c 2025-10-19 16:12:03.120660525 +0200
++++ arc-5.21p/arcunp.c 2025-10-18 22:40:50.146405771 +0200
+@@ -18,13 +18,11 @@
+ */
+ #include <stdio.h>
+ #include "arc.h"
++#include "proto.h"
+ #if _MTS
+ #include <mts.h>
+ #endif
+
+-VOID setcode(), init_usq(), init_ucr(), decomp();
+-VOID arcdie(), codebuf();
+-
+ #include "proto.h"
+
+ /* stuff for repeat unpacking */
+diff -ur arc-5.21p.orig/arcusq.c arc-5.21p/arcusq.c
+--- arc-5.21p.orig/arcusq.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arcusq.c 2025-10-18 21:06:34.357459273 +0200
+@@ -24,8 +24,6 @@
+
+ #include "proto.h"
+
+-VOID arcdie();
+-
+ /* stuff for Huffman unsqueezing */
+
+ #define ERROR (-1)
+diff -ur arc-5.21p.orig/marc.c arc-5.21p/marc.c
+--- arc-5.21p.orig/marc.c 2025-10-19 16:12:03.109815338 +0200
++++ arc-5.21p/marc.c 2025-10-19 16:08:37.734269496 +0200
+@@ -25,6 +25,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "arc.h"
++#include "proto.h"
+
+ #if UNIX
+ #include <sys/types.h>
+@@ -38,9 +39,10 @@
+ #ifndef __STDC__
+ char *calloc(), *malloc(), *realloc(); /* memory managers */
+ #endif
+-int gethdr(), match(), readhdr();
+-VOID arcdie(), filecopy(), setstamp(), writehdr();
+-static VOID copyfile(), expandlst(), merge();
++static VOID expandlst(int n);
++static VOID merge(int nargs, char *arg[]);
++static int gethdr(FILE *f, struct heads *hdr);
++static VOID copyfile(FILE *f, struct heads *hdr, int ver);
+
+ FILE *src; /* source archive */
+ char srcname[STRLEN]; /* source archive name */
+@@ -54,8 +56,6 @@
+ int nargs; /* number of arguments */
+ char *arg[]; /* pointers to arguments */
+ {
+- char *makefnam();
+- char *envfind();
+ #if !_MTS
+ char *arctemp2; /* temp file stuff */
+ #endif
+@@ -290,9 +290,8 @@
+ writehdr(&arch,new); /* mark the end of the archive */
+ }
+
+-int gethdr(f,hdr) /* special read header for merge */
+-FILE *f; /* file to read from */
+-struct heads *hdr; /* storage for header */
++/* special read header for merge */
++static int gethdr(FILE *f, struct heads *hdr)
+ {
+ char *i = hdr->name; /* string index */
+ int n; /* index */
+@@ -322,11 +321,10 @@
+ expandlst(n) /* expand an indirect reference */
+ int n; /* number of entry to expand */
+ {
+- FILE *lf, *fopen(); /* list file, opener */
++ FILE *lf; /* list file, opener */
+ char buf[100]; /* input buffer */
+ int x; /* index */
+ char *p = lst[n]+1; /* filename pointer */
+- char *makefnam();
+
+ if(*p) /* use name if one was given */
+ { makefnam(p,".CMD",buf);
+diff -ur arc-5.21p.orig/proto.h arc-5.21p/proto.h
+--- arc-5.21p.orig/proto.h 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/proto.h 2025-10-19 15:58:49.925845018 +0200
+@@ -1,13 +1,81 @@
+-u_int getbuf PROTO ((FILE *f));
+-u_int getb_ucr PROTO ((FILE *f));
+-u_int getb_usq PROTO ((FILE *f));
+-u_int getb_unp PROTO ((FILE *f));
+-VOID hufb_tab PROTO ((u_char *buf, u_int len));
+-VOID lzw_buf PROTO ((u_char *buf, u_int len, FILE *f));
+-VOID putb_unp PROTO ((u_char *buf, u_int len, FILE *f));
+-VOID putb_ncr PROTO ((u_char *buf, u_int len, FILE *f));
+-VOID putb_pak PROTO ((u_char *buf, u_int len, FILE *f));
+-VOID upper PROTO ((char *string));
+-int move PROTO ((char *oldnam, char *newnam));
+-int crcbuf PROTO ((int, u_int, u_char *));
++#include <unistd.h>
++
++struct heads;
++struct DIRECT;
++struct tm;
++
+ FILE * tmpopen PROTO ((char *path));
++
++VOID runarc(int num, char *arg[]);
++VOID cvtarc(int num, char *arg[]);
++VOID lstarc(int num, char *arg[]);
++VOID delarc(int num, char *arg[]);
++VOID extarc(int num, char *arg[], int prt);
++VOID addarc(int num, char *arg[], int move, int update, int fresh);
++VOID tstarc(void);
++
++/* arcmisc.c */
++VOID exitpause(void);
++FILE * tmpopen(char *path);
++int move(char *oldnam, char *newnam);
++char * makefnam(char *rawfn, char *template, char *result);
++VOID upper(char *string);
++VOID arcdie(const char *s, ...);
++char * gcdir(char *dirname);
++char * dir(char *filename);
++
++/* arcio.c */
++int readhdr(struct heads *hdr, FILE *f);
++VOID writehdr(struct heads *hdr, FILE *f);
++VOID filecopy(FILE *f, FILE *t, long size);
++
++/* arcpack.c */
++VOID pack(FILE *f, FILE *t, struct heads *hdr);
++VOID putb_pak(u_char *buf, u_int len, FILE *f);
++
++/* arcunp.c */
++int unpack(FILE *f, FILE *t, struct heads *hdr);
++VOID putb_ncr(u_char *buf, u_int len, FILE *t);
++VOID putb_unp(u_char *buf, u_int len, FILE *f);
++u_int getb_unp(FILE *f);
++
++/* arcdos.c */
++VOID getstamp(FILE *f, unsigned short *date, unsigned short *time);
++VOID setstamp(char *f, unsigned short date, unsigned short time);
++int izadir(char *filename);
++
++/* arcsvc.c */
++VOID openarc(int chg);
++VOID closearc(int chg);
++int crcbuf(register int crc, register u_int len, register u_char *buf);
++
++/* arcmatch.c */
++int match(char *n, char *t);
++VOID rempath(int nargs, char *arg[]);
++
++/* arccode.c */
++VOID setcode(void);
++VOID codebuf(reg char *buf, u_int len);
++
++/* arcusq.c */
++VOID init_usq(FILE *f);
++u_int getb_usq(FILE *f);
++
++/* arclzw.c */
++VOID init_cm(u_char *buf);
++VOID lzw_buf(u_char *buf, u_int len, FILE *t);
++long pred_cm(FILE *t);
++VOID flsh_cm(FILE *t);
++VOID decomp(int squash, FILE *f, FILE *t);
++VOID init_ucr(int new, FILE *f);
++u_int getb_ucr(FILE *f);
++
++/* arcsq.c */
++VOID init_sq(void);
++VOID hufb_tab(u_char *buf, u_int len);
++long pred_sq(void);
++long head_sq(void);
++long huf_buf(u_char *pbuf, u_int plen, u_int len, FILE *ob);
++
++/* tmclock.c */
++long tmclock(struct tm *tm);
diff --git a/glibc-2.43.patch b/glibc-2.43.patch
new file mode 100644
index 0000000..17cba79
--- /dev/null
+++ b/glibc-2.43.patch
@@ -0,0 +1,213 @@
+diff -up arc-5.21p/arc.c~ arc-5.21p/arc.c
+--- arc-5.21p/arc.c~ 2026-01-28 19:40:47.000000000 +0100
++++ arc-5.21p/arc.c 2026-01-28 19:43:01.245461871 +0100
+@@ -283,9 +283,9 @@ main(num, arg) /* system entry point *
+
+ for (a = arg[1]; *a; a++) { /* scan the option flags */
+ #if !_MTS
+- if (index("AMUFDXEPLVTCR", *a)) { /* if a known command */
++ if (strchr("AMUFDXEPLVTCR", *a)) { /* if a known command */
+ #else
+- if (index("AMUFDXEPLVTC", *a)) {
++ if (strchr("AMUFDXEPLVTC", *a)) {
+ #endif
+ if (opt)/* do we have one yet? */
+ arcdie("Cannot mix %c and %c", opt, *a);
+diff -up arc-5.21p/arc.h~ arc-5.21p/arc.h
+--- arc-5.21p/arc.h~ 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p/arc.h 2026-01-28 19:41:24.186937681 +0100
+@@ -46,11 +46,6 @@
+
+ #define MYBUF 32766 /* Used for fopens and filecopy() */
+
+-#if _MTS || SYSV
+-#define rindex strrchr
+-#define index strchr
+-#endif
+-
+ #if __STDC__
+ #include <stdlib.h>
+ #define VOID void
+diff -up arc-5.21p/arcadd.c~ arc-5.21p/arcadd.c
+--- arc-5.21p/arcadd.c~ 2026-01-28 19:40:47.000000000 +0100
++++ arc-5.21p/arcadd.c 2026-01-28 19:43:01.245699409 +0100
+@@ -83,12 +83,12 @@ int fresh; /* true if fresh
+ for (n = 0; n < num; n++) { /* for each template supplied */
+ strcpy(buf, arg[n]); /* get ready to fix path */
+ #if !_MTS
+- if (!(i = rindex(buf, '\\')))
+- if (!(i = rindex(buf, '/')))
+- if (!(i = rindex(buf, ':')))
++ if (!(i = strrchr(buf, '\\')))
++ if (!(i = strrchr(buf, '/')))
++ if (!(i = strrchr(buf, ':')))
+ i = buf - 1;
+ #else
+- if (!(i = rindex(buf, sepchr[0])))
++ if (!(i = strrchr(buf, sepchr[0])))
+ if (buf[0] != tmpchr[0])
+ i = buf - 1;
+ else
+diff -up arc-5.21p/arcext.c~ arc-5.21p/arcext.c
+--- arc-5.21p/arcext.c~ 2026-01-28 19:40:47.000000000 +0100
++++ arc-5.21p/arcext.c 2026-01-28 19:43:01.246418715 +0100
+@@ -55,12 +55,12 @@ extarc(num, arg, prt) /* extract files
+ for (n = 0; n < num; n++) { /* for each argument */
+ did[n] = 0; /* reset usage flag */
+ #if !_MTS
+- if (!(i = rindex(arg[n], '\\'))) /* find start of name */
+- if (!(i = rindex(arg[n], '/')))
+- if (!(i = rindex(arg[n], ':')))
++ if (!(i = strrchr(arg[n], '\\'))) /* find start of name */
++ if (!(i = strrchr(arg[n], '/')))
++ if (!(i = strrchr(arg[n], ':')))
+ i = arg[n] - 1;
+ #else
+- if (!(i = rindex(arg[n], sepchr[0])))
++ if (!(i = strrchr(arg[n], sepchr[0])))
+ if (arg[n][0] != tmpchr[0])
+ i = arg[n] - 1;
+ else
+@@ -125,13 +125,13 @@ extfile(hdr, path, prt) /* extract a fi
+ strcpy(fix, path); /* note path name template */
+ #if !_MTS
+ if (*path) {
+- if (!(i = rindex(fix, '\\'))) /* find start of name */
+- if (!(i = rindex(fix, '/')))
+- if (!(i = rindex(fix, ':')))
++ if (!(i = strrchr(fix, '\\'))) /* find start of name */
++ if (!(i = strrchr(fix, '/')))
++ if (!(i = strrchr(fix, ':')))
+ i = fix - 1;
+ } else i = fix -1;
+ #else
+- if (!(i = rindex(fix, sepchr[0])))
++ if (!(i = strrchr(fix, sepchr[0])))
+ if (fix[0] != tmpchr[0])
+ i = fix - 1;
+ else
+diff -up arc-5.21p/arcmatch.c~ arc-5.21p/arcmatch.c
+--- arc-5.21p/arcmatch.c~ 2026-01-28 19:40:47.000000000 +0100
++++ arc-5.21p/arcmatch.c 2026-01-28 19:43:01.246992022 +0100
+@@ -120,10 +120,10 @@ rempath(nargs, arg) /* remove paths fro
+ int n; /* index */
+
+ for (n = 0; n < nargs; n++) { /* for each supplied name */
+- if (!(i = rindex(arg[n], '\\'))) /* search for end of
++ if (!(i = strrchr(arg[n], '\\'))) /* search for end of
+ * path */
+- if (!(i = rindex(arg[n], '/')))
+- i = rindex(arg[n], ':');
++ if (!(i = strrchr(arg[n], '/')))
++ i = strrchr(arg[n], ':');
+ if (i) /* if path was found */
+ arg[n] = i + 1; /* then skip it */
+ }
+diff -up arc-5.21p/arcmisc.c~ arc-5.21p/arcmisc.c
+--- arc-5.21p/arcmisc.c~ 2026-01-28 19:40:47.000000000 +0100
++++ arc-5.21p/arcmisc.c 2026-01-28 19:43:01.247109921 +0100
+@@ -44,7 +44,7 @@ chdir(dirname)
+ int drv;
+
+ i = dirname;
+- if ((i = index(dirname, ':')) != NULL) {
++ if ((i = strchr(dirname, ':')) != NULL) {
+ drv = i[-1];
+ i++; /* Move past device spec */
+ if (drv > '\'')
+@@ -178,12 +178,12 @@ makefnam(rawfn, template, result)
+ strcpy(rawfn, i);
+ } else
+ #endif
+- if ((i = rindex(rawbuf, CUTOFF))) {
++ if ((i = strrchr(rawbuf, CUTOFF))) {
+ i++;
+ strcpy(rawfn, i);
+ }
+ #if DOS
+- else if ((i = rindex(rawbuf, ':'))) {
++ else if ((i = strrchr(rawbuf, ':'))) {
+ i++;
+ strcpy(rawfn, i);
+ }
+@@ -316,7 +316,7 @@ dir(filename) /* get files, one by one
+
+ if (Nnum == 0) { /* first call */
+ strcpy(namecopy,filename);
+- if((pattern=rindex(namecopy,CUTOFF))) {
++ if((pattern=strrchr(namecopy,CUTOFF))) {
+ *pattern = 0;
+ pattern++;
+ dirname = namecopy;
+@@ -398,7 +398,7 @@ dir(filepattern)
+ if (filepattern) {
+ strcpy(pattern.name, filepattern);
+ pattern.len = strlen(filepattern);
+- if (!index(filepattern, '?'))
++ if (!strchr(filepattern, '?'))
+ patflag = 1;
+ }
+ if (patflag) {
+@@ -412,7 +412,7 @@ dir(filepattern)
+ else {
+ char *k;
+
+-/* k = index(catreturn.name, ' ');
++/* k = strchr(catreturn.name, ' ');
+ if (k)
+ *k = 0;
+ else { This seems unnecessary now */
+@@ -422,7 +422,7 @@ dir(filepattern)
+ k = catreturn.name;
+ if (*k == tmpchr[0])
+ k++;
+- else if ((k = index(catreturn.name, sepchr[0])))
++ else if ((k = strchr(catreturn.name, sepchr[0])))
+ k++;
+ else
+ k = catreturn.name;
+@@ -446,7 +446,7 @@ dir(filepattern)
+ strcat(pattern, " ");
+ for (i = 20; i < 24; i++)
+ gfname[i] = '\0';
+- if (index(pattern, '?'))
++ if (strchr(pattern, '?'))
+ gfflags = 0x0C;
+ else
+ gfflags = 0x09;
+@@ -457,12 +457,12 @@ dir(filepattern)
+ if (RETCODE)
+ return (NULL);
+ else {
+- k = index(gfname, ' ');
++ k = strchr(gfname, ' ');
+ *k = '\0';
+ k = gfname;
+ if (gfname[0] == tmpchr[0])
+ k++;
+- else if ((k = index(gfname, sepchr[0])))
++ else if ((k = strchr(gfname, sepchr[0])))
+ k++;
+ else
+ k = gfname;
+diff -up arc-5.21p/arcrun.c~ arc-5.21p/arcrun.c
+--- arc-5.21p/arcrun.c~ 2026-01-28 19:40:47.000000000 +0100
++++ arc-5.21p/arcrun.c 2026-01-28 19:43:01.247379889 +0100
+@@ -67,7 +67,7 @@ runfile(hdr, num, arg) /* run a file */
+ FILE *tmp; /* temporary file */
+ char buf[STRLEN]; /* temp file name, fixer */
+ #if DOS
+- char nbuf[64], *i, *rindex();
++ char nbuf[64], *i, *strrchr();
+ #endif
+ #if !GEMDOS
+ int n; /* index */
+@@ -81,7 +81,7 @@ runfile(hdr, num, arg) /* run a file */
+ #else
+ strcpy(nbuf, arctemp);
+ makefnam(nbuf,hdr->name,buf);
+- i = rindex(buf,'.');
++ i = strrchr(buf,'.');
+ #endif
+ #if MSDOS
+ if (!strcmp(i, ".BAS")) {
diff --git a/hdrv1-read-fix.patch b/hdrv1-read-fix.patch
new file mode 100644
index 0000000..f9c0e3c
--- /dev/null
+++ b/hdrv1-read-fix.patch
@@ -0,0 +1,70 @@
+Fix version 1 arc header reading
+
+The code for v1 hdr reading was reading the packed header directly into an
+unpacked struct.
+
+Use the same read to dummy array, then manual unpack to header struct as
+used for v2 headers for v1 headers too.
+
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+diff -ur arc-5.21p/arcio.c arc-5.21p.new/arcio.c
+--- arc-5.21p/arcio.c 2010-08-07 15:06:42.000000000 +0200
++++ arc-5.21p.new/arcio.c 2015-01-16 12:59:43.203289118 +0100
+@@ -37,6 +37,7 @@
+ #endif
+ char name[FNLEN]; /* filename buffer */
+ int try = 0;/* retry counter */
++ int hdrlen;
+ static int first = 1; /* true only on first read */
+
+ if (!f) /* if archive didn't open */
+@@ -92,23 +93,19 @@
+ printf("I think you need a newer version of ARC.\n");
+ exit(1);
+ }
++
+ /* amount to read depends on header type */
++ if (hdrver == 1) {
++ hdrlen = 23; /* old style is shorter */
++ } else {
++ hdrlen = 27;
++ }
+
+- if (hdrver == 1) { /* old style is shorter */
+- if (fread(hdr, sizeof(struct heads) - sizeof(long int), 1, f) != 1)
+- arcdie("%s was truncated", arcname);
+- hdrver = 2; /* convert header to new format */
+- hdr->length = hdr->size; /* size is same when not
+- * packed */
+- } else
+-#if MSDOS
+- if (fread(hdr, sizeof(struct heads), 1, f) != 1)
+- arcdie("%s was truncated", arcname);
+-#else
+- if (fread(dummy, 27, 1, f) != 1)
+- arcdie("%s was truncated", arcname);
++ if (fread(dummy, hdrlen, 1, f) != 1)
++ arcdie("%s was truncated", arcname);
+
+ for (i = 0; i < FNLEN; hdr->name[i] = dummy[i], i++);
++ hdr->name[FNLEN - 1] = 0; /* ensure 0 termination */
+ #if _MTS
+ (void) atoe(hdr->name, strlen(hdr->name));
+ #endif
+@@ -116,8 +113,14 @@
+ hdr->date = (short) ((dummy[18] << 8) + dummy[17]);
+ hdr->time = (short) ((dummy[20] << 8) + dummy[19]);
+ hdr->crc = (short) ((dummy[22] << 8) + dummy[21]);
+- for (i = 0, hdr->length=0; i<4; hdr->length<<=8, hdr->length += dummy[26-i], i++);
+-#endif
++
++ if (hdrver == 1) {
++ hdrver = 2; /* convert header to new format */
++ hdr->length = hdr->size; /* size is same when not
++ * packed */
++ } else {
++ for (i = 0, hdr->length=0; i<4; hdr->length<<=8, hdr->length += dummy[26-i], i++);
++ }
+
+ if (hdr->date > olddate
+ || (hdr->date == olddate && hdr->time > oldtime)) {
diff --git a/manpage-section-fix.patch b/manpage-section-fix.patch
new file mode 100644
index 0000000..7bf339a
--- /dev/null
+++ b/manpage-section-fix.patch
@@ -0,0 +1,23 @@
+This patch changes the man page sections from 1L to 1. This is
+also already changed upstream but not released yet.
+
+Index: arc-5.21p/arc.1
+===================================================================
+--- arc-5.21p.orig/arc.1 2011-01-01 13:37:54.000000000 +0000
++++ arc-5.21p/arc.1 2011-01-01 13:38:03.000000000 +0000
+@@ -1,4 +1,4 @@
+-.TH ARC 1L "11 Nov 1991" "Howard Chu at JPL" "LOCAL COMMANDS"
++.TH ARC 1 "11 Nov 1991" "Howard Chu at JPL" "LOCAL COMMANDS"
+ .SH NAME
+ arc \- pc archive utility
+ .SH SYNOPSIS
+Index: arc-5.21p/marc.1
+===================================================================
+--- arc-5.21p.orig/marc.1 2011-01-01 13:37:57.000000000 +0000
++++ arc-5.21p/marc.1 2011-01-01 13:38:07.000000000 +0000
+@@ -1,4 +1,4 @@
+-.TH MARC 1L "25 Nov 1992" "Howard Chu at JPL" "LOCAL COMMANDS"
++.TH MARC 1 "25 Nov 1992" "Howard Chu at JPL" "LOCAL COMMANDS"
+ .SH NAME
+ marc \- archive merger
+ .SH SYNOPSIS
diff --git a/spelling.patch b/spelling.patch
new file mode 100644
index 0000000..4af5646
--- /dev/null
+++ b/spelling.patch
@@ -0,0 +1,16 @@
+This patch fixes a spelling error in arc's man page. This error
+is already fixed upstream but not released yet.
+
+Index: arc-5.21p/arc.1
+===================================================================
+--- arc-5.21p.orig/arc.1 2011-01-01 13:26:19.000000000 +0000
++++ arc-5.21p/arc.1 2011-01-01 13:34:35.000000000 +0000
+@@ -137,7 +137,7 @@
+ .I Arc
+ Version 2 differs from version 1 in that archive entries
+ are automatically compressed when they are added to the archive,
+-making a separate compression step unecessary. The nature of the
++making a separate compression step unnecessary. The nature of the
+ compression is indicated by the header version number placed in
+ each archive entry, as follows:
+ .nf
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/arc.git/commitdiff/6eae7e8c7166779c18092610cf2a092874c9fea5
More information about the pld-cvs-commit
mailing list