[packages/arj] - rel 8, fix incorrect assumptions about time_t size

baggins baggins at pld-linux.org
Sun Feb 22 14:25:08 CET 2026


commit 0aa9a3991849afe459416a7c3a26014391efe3ff
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Feb 22 15:24:44 2026 +0100

    - rel 8, fix incorrect assumptions about time_t size

 arj.spec     |  4 +++-
 time_t.patch | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+), 1 deletion(-)
---
diff --git a/arj.spec b/arj.spec
index 4008ec9..4a242a6 100644
--- a/arj.spec
+++ b/arj.spec
@@ -2,7 +2,7 @@ Summary:	ARJ archiver for Linux
 Summary(pl.UTF-8):	Archiwizator ARJ dla Linuksa
 Name:		arj
 Version:	3.10.22
-Release:	7
+Release:	8
 Epoch:		1
 License:	GPL
 Group:		Applications/Archiving
@@ -13,6 +13,7 @@ Patch0:		strnlen.patch
 Patch1:		%{name}-glibc.patch
 Patch2:		%{name}-format-security.patch
 Patch3:		no-strip.patch
+Patch4:		time_t.patch
 BuildRequires:	autoconf
 BuildRequires:	automake
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -37,6 +38,7 @@ pakietu zna sposób funkcjonowania programu ARJ pod DOS-em.
 %patch -P1 -p1
 %patch -P2 -p1
 %patch -P3 -p1
+%patch -P4 -p1
 
 %build
 cd gnu
diff --git a/time_t.patch b/time_t.patch
new file mode 100644
index 0000000..4cb9fdc
--- /dev/null
+++ b/time_t.patch
@@ -0,0 +1,55 @@
+--- arj-3.10.22/arjtypes.c.orig	2005-06-23 12:00:54.000000000 +0200
++++ arj-3.10.22/arjtypes.c	2026-02-22 15:23:34.550002556 +0100
+@@ -135,11 +135,11 @@
+ 
+ /* Converts a UNIX timestamp to the DOS style */
+ 
+-static unsigned long ts_unix2dos(const long ts)
++static unsigned long ts_unix2dos(const time_t ts)
+ {
+  struct tm *stm;
+ 
+- stm=arj_localtime((time_t*)&ts);
++ stm=arj_localtime(&ts);
+  return(get_tstamp(stm->tm_year+1900, stm->tm_mon+1, stm->tm_mday,
+         stm->tm_hour, stm->tm_min, stm->tm_sec));
+ }
+@@ -148,13 +148,13 @@
+ 
+ static unsigned long mk_unixtime(int y, int m, int d, int hh, int mm, int ss)
+ {
+- unsigned long u=0, ts;
++ unsigned long u=0;
+  unsigned int i, v;
+  /* Clash with NetBSD/x86-64 patch: leaving rc as unsigned long still permits
+     to escape the year 2038 problem in favor of year 2106 problem, while a
+     dedicated time_t structure can be expected as a 64-bit value on relevant
+     platforms -- ASR fix 25/01/2004 */
+- unsigned long rc;
++ time_t rc, ts;
+  time_t tt;
+  long tzshift, shiftd1, shiftd2;
+  struct tm *stm;
+@@ -191,7 +191,7 @@
+    u+=isleapyear(y);
+  }
+  rc=86400*(unsigned long)(u+d-1)+(unsigned long)hh*3600+(unsigned long)mm*60+(unsigned long)ss;
+- stm=arj_localtime((const long *)&rc);
++ stm=arj_localtime(&rc);
+  debug_assert(stm!=NULL);               /* LIBCS.DLL returns NULL for unixtime beyond
+                                            0x7FFFFFFF */
+  tzshift=(long)stm->tm_hour*3600+(long)stm->tm_min*60;
+@@ -199,11 +199,11 @@
+  ts=rc;
+  #ifdef LOCALTIME_WORKAROUND
+   v=fold_timestamp(&ts);
+-  stm=gmtime((const long *)&ts);
++  stm=gmtime(&ts);
+   debug_assert(stm!=NULL);
+   stm->tm_year+=v;
+  #else
+-  stm=gmtime((const long *)&ts);  
++  stm=gmtime(&ts);
+  #endif
+  shiftd2=stm->tm_mday;
+  /* Local time overruns GMT, add 24 hours for safety */
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/arj.git/commitdiff/0aa9a3991849afe459416a7c3a26014391efe3ff



More information about the pld-cvs-commit mailing list