Skip to content

Commit

Permalink
add workaround for regression in java's jar util; rel 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jpalus committed Mar 30, 2022
1 parent 6f901dc commit a761d83
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
25 changes: 25 additions & 0 deletions java-regr-workaround.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/crc32.c b/crc32.c
index a1bdce5..748b7ba 100644
--- a/crc32.c
+++ b/crc32.c
@@ -19,6 +19,7 @@
MAKECRCH can be #defined to write out crc32.h. A main() routine is also
produced, so that this one source file can be compiled to an executable.
*/
+#include <limits.h>

#ifdef MAKECRCH
# include <stdio.h>
@@ -1065,7 +1066,12 @@ unsigned long ZEXPORT crc32(crc, buf, len)
const unsigned char FAR *buf;
uInt len;
{
+/* if sizeof(unsigned long) > 4 */
+#if ULONG_MAX > 0xffffffffUL
+ return crc32_z(crc & 0xffffffffUL, buf, len);
+#else
return crc32_z(crc, buf, len);
+#endif
}

/* ========================================================================= */
4 changes: 3 additions & 1 deletion zlib.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ Summary(tr.UTF-8): Sıkıştırma işlemleri için kitaplık
Summary(uk.UTF-8): Бібліотека для компресії та декомпресії
Name: zlib
Version: 1.2.12
Release: 1
Release: 2
License: BSD
Group: Libraries
Source0: http://www.zlib.net/current/%{name}-%{version}.tar.gz
# Source0-md5: 5fc414a9726be31427b440b434d05f78
Patch0: %{name}-asm.patch
Patch1: cc.patch
Patch2: java-regr-workaround.patch
URL: http://www.zlib.net/
BuildRequires: autoconf >= 2.50
BuildRequires: automake
Expand Down Expand Up @@ -304,6 +305,7 @@ cp contrib/amd64/amd64-match.S match.S
%endif
%endif
%patch1 -p1
%patch2 -p1

%build
CC="%{__cc}" \
Expand Down

0 comments on commit a761d83

Please sign in to comment.