--- unace-nonfree-2.5.orig/debian/rules +++ unace-nonfree-2.5/debian/rules @@ -0,0 +1,63 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +include /usr/share/dpatch/dpatch.make + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +build: build-stamp +build-stamp: patch + dh_testdir + + # Building package + $(MAKE) CFLAGS="$(CFLAGS)" + + touch build-stamp + +clean: clean-patched unpatch +clean-patched: patch + dh_testdir + dh_testroot + rm -f build-stamp + + # Cleaning package + $(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Installing package + install -D -m 755 unace debian/unace-nonfree/usr/bin/unace + +binary-indep: build install + +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installman debian/manpage/unace.1 + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- unace-nonfree-2.5.orig/debian/control +++ unace-nonfree-2.5/debian/control @@ -0,0 +1,17 @@ +Source: unace-nonfree +Section: non-free/utils +Priority: extra +Maintainer: Fabian Greffrath +Build-Depends: debhelper (>= 5), dpatch +Standards-Version: 3.8.3 +XS-Autobuild: yes + +Package: unace-nonfree +Architecture: alpha amd64 armel hurd-i386 i386 ia64 mipsel kfreebsd-i386 kfreebsd-amd64 +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: extract, test and view .ace archives (non-free version) + The unace utility is used for extracting, testing and viewing the contents of + archives created with the ACE archiver. + . + Unlike the unace package which can only extract ACE 1.0 archives, the + unace-nonfree package allows to unpack all current ACE archives. --- unace-nonfree-2.5.orig/debian/README.source +++ unace-nonfree-2.5/debian/README.source @@ -0,0 +1,26 @@ +This package uses dpatch to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +To get the fully patched source after unpacking the source package, cd +to the root level of the source package and run: + + debian/rules patch + +Removing a patch is as simple as removing its entry from the +debian/patches/00list file, and please also remove the patch file +itself. + +Creating a new patch is done with "dpatch-edit-patch patch XX_patchname" +where you should replace XX with a new number and patchname with a +descriptive shortname of the patch. You can then simply edit all the +files your patch wants to edit, and then simply "exit 0" from the shell +to actually create the patch file. + +To tweak an already existing patch, call "dpatch-edit-patch XX_patchname" +and replace XX_patchname with the actual filename from debian/patches +you want to use. + +To clean up afterwards again, "debian/rules unpatch" will do the +work for you - or you can of course choose to call +"fakeroot debian/rules clean" all together. --- unace-nonfree-2.5.orig/debian/preinst +++ unace-nonfree-2.5/debian/preinst @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +case "$1" in + install) + dpkg-divert --package unace-nonfree --add --rename --divert \ + /usr/bin/unace-free /usr/bin/unace + + dpkg-divert --package unace-nonfree --add --rename --divert \ + /usr/share/man/man1/unace-free.1.gz /usr/share/man/man1/unace.1.gz + ;; + + upgrade|abort-upgrade) + + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 --- unace-nonfree-2.5.orig/debian/copyright +++ unace-nonfree-2.5/debian/copyright @@ -0,0 +1,70 @@ +This package was debianized by Fabian Greffrath on +Mon, 5 Dec 2005 19:01:38 +0100. + +This package is autobuildable. It is distributed under the Public UnAce Licence, +which does not impose restrictions related to architecture or distribution. + +The original source code was obtained by mail from the upstream author +Marcel Lemke . + +Copyright Holder: Ace Compression Software + +License: + + Copyright (C) 2005 Ace Compression Software + All rights reserved. + + Public UnAce Licence + -------------------- + + The Public UnAce Package (v2.0 or later if not otherwise stated) is + distritbuted under the following licence: + + "Package" refers to the collection of files distributed by the Copyright + Holder, and derivatives of that collection of files created through + textual modification. + + "Standard Version" refers to such a Package if it has not been modified, + or has been modified in accordance with the wishes of the Copyright + Holder. + + "Distribution" as it is used here means making data available to a third + party. No matter in which way the data is made available. + + "Copyright Holder" is ACE Compression Software. + + "Distribution Partner" is e-merge GmbH (authorised signatory). + + + 1. The Standard Version of Public UnAce Package may be freely + distributed. + + 2. The UnAce sources may be used in any software to handle ACE archives + without limitations free of charge, but must not be used to reproduce + the ACE compression algorithm. This means that that the code must not + be used to develop an ACE compatible archiver (that is: software + capable of compressing to Ace archives) in any way. + + 3. Distribution of modified Public UnAce sources (as part of other + software or as stand-alone package) requires that it is clearly + stated in the documentation and source code that it is distributed + under the Public UnAce Licence. The Public UnAce Licence has to be + included in this package. + + 4. The name of the Copyright Holder or the support of ACE archives may + not be used to endorse or promote products derived from this package + without specific prior written permission from the Copyright Holder + or its Distribution Partner. + + 5. This Software is distributed "AS IS". NO WARRANTY OF ANY KIND IS + EXPRESSED OR IMPLIED. YOU USE AT YOUR OWN RISK. THE AUTHOR WILL NOT + BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND + OF LOSS WHILE USING OR MISUSING THIS SOFTWARE. + + 6. Installing and using the Public UnAce Package signifies acceptance of + these terms and conditions of the license. + + Marcel Lemke, ACE Compression Software + +The Debian packaging is © 2005-2009, Fabian Greffrath and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. --- unace-nonfree-2.5.orig/debian/changelog +++ unace-nonfree-2.5/debian/changelog @@ -0,0 +1,104 @@ +unace-nonfree (2.5-6) unstable; urgency=low + + * Updated my email address. + * Bumped Standards-Version to 3.8.3. + * Removed duplicate binary control field "section". + * Added debian/README.source file. + * Fixed Debian packaging copyright information. + * debian/patches/13-maximum-file-name-length.dpatch: New patch, + increase buffer to cater for maximum file name length (LP: #179684). + * Added debian/watch file. + + -- Fabian Greffrath Mon, 14 Dec 2009 09:23:43 +0100 + +unace-nonfree (2.5-5) unstable; urgency=low + + * Upload to unstable. + * debian/control: + + Bumped Standards-Version to 3.7.3. + * debian/patches/03-gcc-call.dpatch: + + Merged with a patch courtesy of Mike Frysinger + that "uses standard env vars so it behaves like autotools and removes + pointless -I paths that for native builds are redundant and for cross + builds broken." Thank you very much! + + -- Fabian Greffrath Fri, 11 Apr 2008 16:00:00 +0100 + +unace-nonfree (2.5-4) experimental; urgency=low + + * Upload to experimental. + * debian/control: + + Build on all little-endian architectures. + + -- Fabian Greffrath Mon, 11 Feb 2008 10:00:00 +0100 + +unace-nonfree (2.5-3) unstable; urgency=low + + * debian/control: + + Dropped useless libncurses-dev from Build-Depends. + + Reduced supported Archs to i386 and amd64 for the time being. + + Added ${misc:Depends} to Depends. + * debian/rules: + + Patch before clean, unpatch after clean. + + Do not ignore 'make clean' errors anymore. + * debian/patches/01-rm-f.dpatch: + + Updated to force remove in clean rule. + * debian/patches/03-gcc-call.dpatch: + + Updated to call the C-Compiler via $(CC) and drop useless + linking against libncurses. + + * Applied a series of patches courtesy of Michael Karcher + : + * debian/patches/02-no-io_h.dpatch: + + Updated to include instead of . + * debian/patches/04-64bit.dpatch: + + Replace declare.h by a generic stdint based version (Closes: #449395). + * debian/patches/05-warning-fixes.dpatch: + + This patch fixes harmless warnings, mostly suggested parentheses. + * debian/patches/06-fix-bad-pointer-arith.dpatch: + + This patch removes non-portable pointer arithmetics and useless + casts of pointers to integers. + * debian/patches/07-fix-free-aliasing-issue.dpatch: + + This patch redefines how BASE_MEMORY_FreeCheck works, and avoids + tons of "may break strict aliasing rules" warnings. It also removes + casts on invocation. + * debian/patches/08-ulonglong-printf.dpatch: + + This patch fixes a portability issue about printing big numbers. + * debian/patches/09-utf8-filenames.dpatch: + + This patch makes unace use utf8 filenames on linux instead of Latin1. + * debian/patches/10-uninorm-signedness.dpatch: + + Fixes prototypes in unincore.h to match uninorm.c. + * debian/patches/11-possibly-critical.dpatch: + + Fixes a possible security issue by initialising a local variable. + * debian/patches/12-cast-filetime.dpatch: + + Expresses access to bitfield as 32 bit variable using a union to + not violate the strict aliasing rule. The code is still inherently + non-portable. + + -- Fabian Greffrath Tue, 23 Nov 2007 10:15:00 +0100 + +unace-nonfree (2.5-2) unstable; urgency=low + + * Split and re-organized patches. + * debian/changelog: + + Reassigned closed bug numbers in previous changelog entry. + * debian/control: + + Changed priority from optional to extra. + + Added 'XS-Autobuild: yes' field. + * debian/copyright: + + Designated package as autobuildable. + + Added copyright notice for the Debian packaging. + * debian/rules: + + Define CFLAGS and pass them to $(MAKE) call. + + Pass manpage/unace.1 to dh_installman call. + * debian/manpages: + + Removed. + + -- Fabian Greffrath Tue, 3 Jul 2007 15:18:00 +0100 + +unace-nonfree (2.5-1) unstable; urgency=low + + * Initial release (Closes: #259761). + * Added diversions to the free unace binary and manpage (Closes: #332598). + + -- Fabian Greffrath Mon, 30 Dec 2005 17:42:32 +0100 --- unace-nonfree-2.5.orig/debian/watch +++ unace-nonfree-2.5/debian/watch @@ -0,0 +1,4 @@ +version=3 +opts="dversionmangle=s/\.//" \ +http://www.winace.com/down.html \ +http://www.winace.com/files/linunace(.*)\.tgz --- unace-nonfree-2.5.orig/debian/postrm +++ unace-nonfree-2.5/debian/postrm @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +case "$1" in + remove) + dpkg-divert --package unace-nonfree --remove --rename --divert \ + /usr/bin/unace-free /usr/bin/unace + + dpkg-divert --package unace-nonfree --remove --rename --divert \ + /usr/share/man/man1/unace-free.1.gz /usr/share/man/man1/unace.1.gz + ;; + + purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 --- unace-nonfree-2.5.orig/debian/compat +++ unace-nonfree-2.5/debian/compat @@ -0,0 +1 @@ +5 --- unace-nonfree-2.5.orig/debian/manpage/unace.1 +++ unace-nonfree-2.5/debian/manpage/unace.1 @@ -0,0 +1,60 @@ +.TH unace 1 2005-12-05 "2.50" "unace manual" +.SH NAME +unace \- extract, test and view ACE archives +.SH SYNOPSIS +.B unace +.RI < command > +.RI [\-< sw1 >\ ...] +.RI < archive > +.RI [< base_dir >\e] +.RI [< files >/@< filelist >] +.SH DESCRIPTION +The +.B unace +utility is used for extracting, testing and viewing +the contents of archives created with the ACE archiver. +.SH COMMANDS +.TP +.B e +Extract files +.TP +.B l +List archive +.TP +.B t +Test archive integrity +.TP +.B v +List archive (verbose) +.TP +.B x +Extract files with full path +.SH SWITCHES +.TP +.BR c [\-] +Show comments (default \+) +.TP +.BR f [\-] +Full path matching (default \-) +.TP +.BR o [\-] +Overwrite files (default \-) +.TP +.BR p <\fIpass\fP> +Set password +.TP +.BR y [\-] +Assume yes on all queries (default \-) +.TP +.BR x <\fIfiles\fP/@\fIlist\fP> +Exclude <\fIfiles\fP> or files in <\fIlist\fP> from process +.SH SEE ALSO +.BR gzip (1), +.BR bzip2 (1), +.BR zip (1), +.BR arj (1), +.BR ppmd (1). +.SH AUTHORS +This manual page was written by Guillem Jover +and revised by Fabian Greffrath +for the Debian project (but may be used by others). --- unace-nonfree-2.5.orig/debian/patches/01-only-unace.dpatch +++ unace-nonfree-2.5/debian/patches/01-only-unace.dpatch @@ -0,0 +1,46 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 01-unace-only.dpatch by Fabian Greffrath +## +## DP: Do not try to include Makefiles for ace or unace.dll +## DP: and force remove in clean rule. + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/base.mk unace-nonfree-2.5/base.mk +--- unace-nonfree-2.5~/base.mk 2007-11-22 00:59:54.000000000 +0100 ++++ unace-nonfree-2.5/base.mk 2007-11-22 01:00:15.961423292 +0100 +@@ -427,9 +427,7 @@ + ############################################################################## + + ifndef ISWMAKE +-include $(MAKE_DIR)baseace.mk + include $(MAKE_DIR)baseuace.mk + else +-!include $(MAKE_DIR)baseace.mk + !include $(MAKE_DIR)baseuace.mk + endif +diff -urNad unace-nonfree-2.5~/makefile unace-nonfree-2.5/makefile +--- unace-nonfree-2.5~/makefile 2007-11-22 00:59:54.000000000 +0100 ++++ unace-nonfree-2.5/makefile 2007-11-22 01:01:00.331410500 +0100 +@@ -29,8 +29,8 @@ + all: unace + + clean: +- rm unace +- rm linunace25.tgz ++ rm -f unace ++ rm -f linunace25.tgz + + include $(MAKE_DIR)base.mk + include $(MAKE_DIR)apps.mk +diff -urNad unace-nonfree-2.5~/unace.mk unace-nonfree-2.5/unace.mk +--- unace-nonfree-2.5~/unace.mk 2007-11-22 00:59:54.000000000 +0100 ++++ unace-nonfree-2.5/unace.mk 2007-11-22 01:00:15.964749045 +0100 +@@ -27,8 +27,6 @@ + + ifndef ISWMAKE + include $(MAKE_DIR)unaceexe.mk +-include $(MAKE_DIR)unacedll.mk + else + !include $(MAKE_DIR)unaceexe.mk +-!include $(MAKE_DIR)unacedll.mk + endif --- unace-nonfree-2.5.orig/debian/patches/13-maximum-file-name-length.dpatch +++ unace-nonfree-2.5/debian/patches/13-maximum-file-name-length.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 13-maximum-file-name-length.dpatch by P Stahlman +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Increase buffer to cater for maximum file name length (LP: #179684). + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/source/apps/exe/acefuncs/acefuncs.c unace-nonfree-2.5/source/apps/exe/acefuncs/acefuncs.c +--- unace-nonfree-2.5~/source/apps/exe/acefuncs/acefuncs.c 2009-12-11 10:40:11.000000000 +0100 ++++ unace-nonfree-2.5/source/apps/exe/acefuncs/acefuncs.c 2009-12-11 10:40:29.000000000 +0100 +@@ -27,7 +27,7 @@ + + void APPS_EXE_ACEFUNCS_List(BOOL Verbose) + { +-CHAR ShortStr[80], ++CHAR ShortStr[BASE_LFN_MAXLEN], + SizeStr1[80], + SizeStr2[80], + OutputStr[160]; --- unace-nonfree-2.5.orig/debian/patches/06-fix-bad-pointer-arith.dpatch +++ unace-nonfree-2.5/debian/patches/06-fix-bad-pointer-arith.dpatch @@ -0,0 +1,241 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 06-fix-bad-pointer-arith.dpatch by Michael Karcher +## +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: This patch removes non-portable pointer arithmetics and useless +## DP: casts of pointers to integers. + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/source/apps/exe/input/input.c unace-nonfree-2.5/source/apps/exe/input/input.c +--- unace-nonfree-2.5~/source/apps/exe/input/input.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/apps/exe/input/input.c 2007-11-22 00:19:02.722167305 +0100 +@@ -169,6 +169,7 @@ + TempStr[200]; + INT TimeCount; + UINT ButtonNumber; ++PCHAR ButtonPtr; + PCHAR Output; + + APPS_EXE_CONVERT_MakeStrShorter(ShortStr1, Description1, 79); +@@ -207,11 +208,11 @@ + APPS_EXE_INPUT.LastKey = APPS_EXE_MESSAGES.YANC[3]; + } + } +- while (!(ButtonNumber = +- (LONG) strchr(APPS_EXE_MESSAGES.YANC, APPS_EXE_INPUT.LastKey)) ++ while (!(ButtonPtr = ++ strchr(APPS_EXE_MESSAGES.YANC, APPS_EXE_INPUT.LastKey)) + && !BASE_ERROR_EXTERN_HandleCancel(0)); + +- ButtonNumber -= (LONG) APPS_EXE_MESSAGES.YANC; ++ ButtonNumber = ButtonPtr - APPS_EXE_MESSAGES.YANC; + + if (!BASE_ERROR.ErrorCode) + { +diff -urNad unace-nonfree-2.5~/source/apps/unace/exe/commline/commline.c unace-nonfree-2.5/source/apps/unace/exe/commline/commline.c +--- unace-nonfree-2.5~/source/apps/unace/exe/commline/commline.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/apps/unace/exe/commline/commline.c 2007-11-22 00:19:02.724995752 +0100 +@@ -42,15 +42,17 @@ + + void APPS_UNACE_EXE_COMMLINE_Init(void) + { ++ INT SearchExcludeListMax; ++ + APPS_EXE_COMMLINE.TimeOutLimit = 600; + + BASE_FILELIST.SearchExcludeListEnd = + BASE_FILELIST.SearchExcludeList = +- (PCHAR) BASE_MEMORY_GetMemBase2((PINT) +- &BASE_FILELIST.SearchExcludeListMax, ++ (PCHAR) BASE_MEMORY_GetMemBase2(&SearchExcludeListMax, + 1); + +- BASE_FILELIST.SearchExcludeListMax += (INT) BASE_FILELIST.SearchExcludeList; ++ BASE_FILELIST.SearchExcludeListMax = SearchExcludeListMax + ++ BASE_FILELIST.SearchExcludeList; + + APPS_EXE_OUTPUT.DoUseStdOutput = 1; + +@@ -265,12 +267,12 @@ + + void APPS_UNACE_EXE_COMMLINE_GetFileListInit(void) + { ++ INT SearchListMax; + BASE_FILELIST.SearchListEnd = + BASE_FILELIST.SearchList = +- (PCHAR) BASE_MEMORY_GetMemBase2((PINT) +- &BASE_FILELIST.SearchListMax, 1); ++ (PCHAR) BASE_MEMORY_GetMemBase2(&SearchListMax,1); + +- BASE_FILELIST.SearchListMax += (INT) BASE_FILELIST.SearchListEnd; ++ BASE_FILELIST.SearchListMax = SearchListMax + BASE_FILELIST.SearchListEnd; + } + + /*-----------------APPS_UNACE_EXE_COMMLINE_GetFileListDone---------------*/ +diff -urNad unace-nonfree-2.5~/source/base/all/arcblk/arcblk.c unace-nonfree-2.5/source/base/all/arcblk/arcblk.c +--- unace-nonfree-2.5~/source/base/all/arcblk/arcblk.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/arcblk/arcblk.c 2007-11-22 00:19:02.724995752 +0100 +@@ -218,8 +218,8 @@ + memmove(&BASE_ARCBLK.Header.File.FTIME, + &BASE_ARCBLK.Header.File32.FTIME, + sizeof(BASE_ARCBLK.Header) +- - ((ULONG)&BASE_ARCBLK.Header.File.FTIME +- - (ULONG)&BASE_ARCBLK.Header)); ++ - ((PCHAR)&BASE_ARCBLK.Header.File.FTIME ++ - (PCHAR)&BASE_ARCBLK.Header)); + + BASE_ARCBLK.Header.File.PSIZE = PSIZE; + BASE_ARCBLK.Header.File.SIZE = SIZE; +@@ -239,8 +239,8 @@ + memmove(&BASE_ARCBLK.Header.Recovery.CLUSTER, + &BASE_ARCBLK.Header.Recovery32.CLUSTER, + sizeof(BASE_ARCBLK.Header) +- - ((ULONG)&BASE_ARCBLK.Header.Recovery.CLUSTER +- - (ULONG)&BASE_ARCBLK.Header)); ++ - ((PCHAR)&BASE_ARCBLK.Header.Recovery.CLUSTER ++ - (PCHAR)&BASE_ARCBLK.Header)); + + BASE_ARCBLK.Header.Recovery.REC_BLK_SIZE = REC_BLK_SIZE; + BASE_ARCBLK.Header.Recovery.REL_STRT = REL_STRT; +@@ -259,8 +259,8 @@ + memmove(&BASE_ARCBLK.Header.Basic.other, + &BASE_ARCBLK.Header.Basic32.other, + sizeof(BASE_ARCBLK.Header) +- - ((ULONG)&BASE_ARCBLK.Header.Basic.other +- - (ULONG)&BASE_ARCBLK.Header)); ++ - ((PCHAR)&BASE_ARCBLK.Header.Basic.other ++ - (PCHAR)&BASE_ARCBLK.Header)); + + BASE_ARCBLK.Header.Basic.ADDSIZE = ADDSIZE; + +diff -urNad unace-nonfree-2.5~/source/base/all/archives/ace/ace.c unace-nonfree-2.5/source/base/all/archives/ace/ace.c +--- unace-nonfree-2.5~/source/base/all/archives/ace/ace.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/archives/ace/ace.c 2007-11-22 00:19:02.724995752 +0100 +@@ -35,12 +35,12 @@ + if (!memcmp(&BASE_ARCHIVES_TEST.TestBuffer[I], BASE_ACESTRUC_ACESIGN, + BASE_ACESTRUC_ACESIGNLEN) + && (FilePos = BASE_DIRDATA_Dir1.ArchiveBegin + I +- - ((INT) BASE_ARCBLK.Header.Main.ACESIGN +- - (INT) &BASE_ARCBLK.Header)) ++ - ((PCHAR) BASE_ARCBLK.Header.Main.ACESIGN ++ - (PCHAR) &BASE_ARCBLK.Header)) + >= 0) + { +- Flags = ((INT) BASE_ARCBLK.Header.Main.ACESIGN - (INT) &BASE_ARCBLK.Header); +- Flags = ((INT) &BASE_ARCBLK.Header.Main.ACESIGN - (INT) &BASE_ARCBLK.Header); ++ Flags = ((PCHAR) BASE_ARCBLK.Header.Main.ACESIGN - (PCHAR) &BASE_ARCBLK.Header); ++ Flags = ((PCHAR) &BASE_ARCBLK.Header.Main.ACESIGN - (PCHAR) &BASE_ARCBLK.Header); + + BASE_DOSFUNCS_LSeek(BASE_ARCHIVES_TEST.ArchiveHandle, FilePos, SEEK_SET); + read(BASE_ARCHIVES_TEST.ArchiveHandle, (PCHAR) &BASE_ARCBLK.Header, 4); +diff -urNad unace-nonfree-2.5~/source/base/all/filelist/filelist.c unace-nonfree-2.5/source/base/all/filelist/filelist.c +--- unace-nonfree-2.5~/source/base/all/filelist/filelist.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/filelist/filelist.c 2007-11-22 00:19:02.728328838 +0100 +@@ -314,6 +314,7 @@ + BOOL DoOutputNoFilesError) + { + PVOID SavedScreenPtr; ++ULONG PosIndex, LastIndex; + + BASE_MSGOUT_EXTERN_ListCreateBegin(&SavedScreenPtr); + +@@ -344,14 +345,14 @@ + BASE_FILELIST.Number + * sizeof(tBASE_FILELIST_FileData)); + +- BASE_FILELIST.Pos -= (ULONG) BASE_FILELIST.List; +- BASE_FILELIST.Last -= (ULONG) BASE_FILELIST.List; +- ++ PosIndex = BASE_FILELIST.Pos - BASE_FILELIST.List; ++ LastIndex = BASE_FILELIST.Last - BASE_FILELIST.List; ++ + BASE_FILELIST.List = (PCHAR) BASE_MEMORY_ReAlloc(BASE_FILELIST.List, +- (ULONG) BASE_FILELIST.Last); ++ LastIndex); + +- BASE_FILELIST.Pos += (ULONG) BASE_FILELIST.List; +- BASE_FILELIST.Last += (ULONG) BASE_FILELIST.List; ++ BASE_FILELIST.Pos = BASE_FILELIST.List + PosIndex; ++ BASE_FILELIST.Last = BASE_FILELIST.List + LastIndex; + + BASE_MEMORY_Optimize(); + +diff -urNad unace-nonfree-2.5~/source/base/all/lfn/nont.c unace-nonfree-2.5/source/base/all/lfn/nont.c +--- unace-nonfree-2.5~/source/base/all/lfn/nont.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/lfn/nont.c 2007-11-22 00:19:02.728328838 +0100 +@@ -131,7 +131,7 @@ + CharPos1 = &Name[strlen(Name)]; + } + +- Len = (UINT) CharPos1 - (UINT) Name; ++ Len = (PCHAR) CharPos1 - (PCHAR) Name; + + for (I = 0; I < Len; I++) + { +diff -urNad unace-nonfree-2.5~/source/base/all/pathfunc/pathfunc.c unace-nonfree-2.5/source/base/all/pathfunc/pathfunc.c +--- unace-nonfree-2.5~/source/base/all/pathfunc/pathfunc.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/pathfunc/pathfunc.c 2007-11-22 00:19:02.731662133 +0100 +@@ -195,18 +195,18 @@ + + if (WildcardPos < PointPos && WildcardPos) + { +- SourceIndex = (LONG) WildcardPos - (LONG) SourceStr; ++ SourceIndex = WildcardPos - SourceStr; + } + else + { + if (PointPos) + { +- SourceIndex = (LONG) PointPos - (LONG) SourceStr; ++ SourceIndex = PointPos - SourceStr; + } + else + { + SourceIndex = WildcardPos ? +- (LONG) WildcardPos - (LONG) SourceStr : ++ WildcardPos - SourceStr : + strlen(SourceStr); + } + } +@@ -227,7 +227,7 @@ + + if (PointPos) + { +- SourceIndex = (INT) PointPos - (INT) SourceStr + 1; ++ SourceIndex = PointPos - SourceStr + 1; + CharsToCopy = 0; + + while (SourceStr[SourceIndex] && SourceStr[SourceIndex] != '*') +@@ -276,7 +276,7 @@ + return 0; + } + +- Result = (UINT) SlashPos - (UINT) Path + 1; ++ Result = SlashPos - Path + 1; + } + else + { +@@ -323,7 +323,7 @@ + } + + *SlashPos = 0; +- SlashPos = SlashPos - (UINT) Dir + (UINT) FileName; ++ SlashPos = SlashPos - Dir + FileName; + + if (*SlashPos == BASE_PATHFUNC_SEPARATOR) + { +diff -urNad unace-nonfree-2.5~/source/base/all/memory/memory.c unace-nonfree-2.5/source/base/all/memory/memory.c +--- unace-nonfree-2.5~/source/base/all/memory/memory.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/memory/memory.c 2007-11-22 00:19:02.731662133 +0100 +@@ -238,8 +237,8 @@ + + BASE_MEMORY_EXTERN_OptimizeOtherMemory(); + +- I = (INT) BASE_FILELIST.Last - (INT) BASE_FILELIST.List; +- J = (INT) BASE_FILELIST.Pos - (INT) BASE_FILELIST.List; ++ I = BASE_FILELIST.Last - BASE_FILELIST.List; ++ J = BASE_FILELIST.Pos - BASE_FILELIST.List; + BASE_FILELIST.List = (PCHAR)BASE_MEMORY_ReAllocSameSize(BASE_FILELIST.List); + BASE_FILELIST.Last = BASE_FILELIST.List + I; + BASE_FILELIST.Pos = BASE_FILELIST.List + J; --- unace-nonfree-2.5.orig/debian/patches/07-fix-free-aliasing-issue.dpatch +++ unace-nonfree-2.5/debian/patches/07-fix-free-aliasing-issue.dpatch @@ -0,0 +1,190 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 07-fix-free-aliasing-issue.dpatch by Michael Karcher +## +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: This patch redefines how BASE_MEMORY_FreeCheck works, and avoids +## DP: tons of "may break strict aliasing rules" warnings. It also removes +## DP: casts on invocation. + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/source/apps/exe/messages/messages.c unace-nonfree-2.5/source/apps/exe/messages/messages.c +--- unace-nonfree-2.5~/source/apps/exe/messages/messages.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/apps/exe/messages/messages.c 2007-11-22 00:19:02.722167305 +0100 +@@ -107,7 +107,7 @@ + + APPS_EXE_MESSAGES_Skip(Start - 22); + +- BASE_MEMORY_FreeCheck((PVOID *) &APPS_EXE_MESSAGES.MessagesBuf); ++ BASE_MEMORY_FreeCheck(APPS_EXE_MESSAGES.MessagesBuf); + + if (!(APPS_EXE_MESSAGES.MessagesBuf = + (PCHAR) BASE_MEMORY_GetMem(*Size + 1))) +diff -urNad unace-nonfree-2.5~/source/base/all/archives/read/read.c unace-nonfree-2.5/source/base/all/archives/read/read.c +--- unace-nonfree-2.5~/source/base/all/archives/read/read.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/archives/read/read.c 2007-11-22 00:19:02.724995752 +0100 +@@ -22,8 +22,8 @@ + + void BASE_ARCHIVES_READ_FreeArchiveList(void) + { +- BASE_MEMORY_FreeCheck((PVOID *) &BASE_ARCHIVES_READ.FileData); +- BASE_MEMORY_FreeCheck((PVOID *) &BASE_ARCHIVES_READ.FileNames); ++ BASE_MEMORY_FreeCheck(BASE_ARCHIVES_READ.FileData); ++ BASE_MEMORY_FreeCheck(BASE_ARCHIVES_READ.FileNames); + } + + /*-----------------BASE_ARCHIVES_READ_GetArchiveList---------------------*/ +diff -urNad unace-nonfree-2.5~/source/base/all/bufread/bufread.c unace-nonfree-2.5/source/base/all/bufread/bufread.c +--- unace-nonfree-2.5~/source/base/all/bufread/bufread.c 2007-11-22 00:19:02.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/bufread/bufread.c 2007-11-22 00:19:02.724995752 +0100 +@@ -134,7 +134,7 @@ + { + close(BASE_BUFREAD.Handle); + BASE_BUFREAD.Handle = -1; +- BASE_MEMORY_FreeCheck((PVOID *) &BASE_BUFREAD.Buf); ++ BASE_MEMORY_FreeCheck(BASE_BUFREAD.Buf); + } + + /*-----------------BASE_BUFREAD_Tell-------------------------------------*/ +diff -urNad unace-nonfree-2.5~/source/base/all/dcpr/comments/comments.c unace-nonfree-2.5/source/base/all/dcpr/comments/comments.c +--- unace-nonfree-2.5~/source/base/all/dcpr/comments/comments.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/dcpr/comments/comments.c 2007-11-22 00:19:02.724995752 +0100 +@@ -45,7 +45,7 @@ + { + if (BASE_DCPR.DoFreeReadBuf) + { +- BASE_MEMORY_FreeCheck((PVOID *) &BASE_DCPR.ReadBuf); ++ BASE_MEMORY_FreeCheck(BASE_DCPR.ReadBuf); + } + } + +diff -urNad unace-nonfree-2.5~/source/base/all/dcpr/dcpr.c unace-nonfree-2.5/source/base/all/dcpr/dcpr.c +--- unace-nonfree-2.5~/source/base/all/dcpr/dcpr.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/dcpr/dcpr.c 2007-11-22 00:19:02.728328838 +0100 +@@ -301,8 +301,8 @@ + { + if (BASE_DCPR.IsInitialized) + { +- BASE_MEMORY_FreeCheck((PVOID *) &BASE_DCPR.ReadBuf); +- BASE_MEMORY_FreeCheck((PVOID *) &BASE_DCPR_LZ77.Dictionary); ++ BASE_MEMORY_FreeCheck(BASE_DCPR.ReadBuf); ++ BASE_MEMORY_FreeCheck(BASE_DCPR_LZ77.Dictionary); + BASE_DCPR.IsInitialized = 0; + BASE_MEMORY_Optimize(); + } +diff -urNad unace-nonfree-2.5~/source/base/all/dcpr/pic/pic.c unace-nonfree-2.5/source/base/all/dcpr/pic/pic.c +--- unace-nonfree-2.5~/source/base/all/dcpr/pic/pic.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/dcpr/pic/pic.c 2007-11-22 00:19:02.728328838 +0100 +@@ -137,7 +137,7 @@ + BASE_DCPR_PIC.Data[0] -= BASE_DCPR_PIC.Planes; + BASE_DCPR_PIC.Data[1] -= BASE_DCPR_PIC.Planes; + +- BASE_MEMORY_FreeCheck((PVOID *) &BASE_DCPR_PIC.Data[0]); +- BASE_MEMORY_FreeCheck((PVOID *) &BASE_DCPR_PIC.Data[1]); ++ BASE_MEMORY_FreeCheck(BASE_DCPR_PIC.Data[0]); ++ BASE_MEMORY_FreeCheck(BASE_DCPR_PIC.Data[1]); + } + } +diff -urNad unace-nonfree-2.5~/source/base/all/extract/extract.c unace-nonfree-2.5/source/base/all/extract/extract.c +--- unace-nonfree-2.5~/source/base/all/extract/extract.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/extract/extract.c 2007-11-22 00:19:02.728328838 +0100 +@@ -232,10 +232,10 @@ + { + BASE_LFN_SetFileAttributes(BASE_STATE.DestinationFileName, Attr); + BASE_DOSFUNCS_SetFileSecurity(BASE_STATE.DestinationFileName, NTFSSecurity); +- BASE_MEMORY_FreeCheck((PVOID)&NTFSSecurity); ++ BASE_MEMORY_FreeCheck(NTFSSecurity); + } + +- BASE_MEMORY_FreeCheck((PVOID *) &Buf); ++ BASE_MEMORY_FreeCheck(Buf); + + return; + +diff -urNad unace-nonfree-2.5~/source/base/all/filelist/filelist.c unace-nonfree-2.5/source/base/all/filelist/filelist.c +--- unace-nonfree-2.5~/source/base/all/filelist/filelist.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/filelist/filelist.c 2007-11-22 00:19:02.728328838 +0100 +@@ -290,7 +290,7 @@ + if (!(BASE_FILELIST.ListFileData = + (pBASE_FILELIST_FileData) BASE_MEMORY_GetMemBase2(&BufSize, 1))) + { +- BASE_MEMORY_FreeCheck((PVOID *) &BASE_FILELIST.List); ++ BASE_MEMORY_FreeCheck(BASE_FILELIST.List); + + return; + } +@@ -303,8 +303,8 @@ + + void BASE_FILELIST_Done(void) + { +- BASE_MEMORY_FreeCheck((PVOID *) &BASE_FILELIST.List); +- BASE_MEMORY_FreeCheck((PVOID *) &BASE_FILELIST.ListFileData); ++ BASE_MEMORY_FreeCheck(BASE_FILELIST.List); ++ BASE_MEMORY_FreeCheck(BASE_FILELIST.ListFileData); + BASE_MEMORY_Optimize(); + } + +diff -urNad unace-nonfree-2.5~/source/base/all/memory/memory.c unace-nonfree-2.5/source/base/all/memory/memory.c +--- unace-nonfree-2.5~/source/base/all/memory/memory.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/memory/memory.c 2007-11-22 00:19:02.731662133 +0100 +@@ -150,13 +150,12 @@ + + /*-----------------BASE_MEMORY_FreeCheck---------------------------------*/ + +-void BASE_MEMORY_FreeCheck(PVOID *Pointer) ++void BASE_MEMORY_FreeCheck_(PVOID Pointer) + { +- if (*Pointer) ++ if (Pointer) + { +- BASE_MEMORY.MaxAllocate += BASE_MEMORY_Size(*Pointer); +- free((PVOID) (((PULONG) *Pointer) - 1)); +- *Pointer = NULL; ++ BASE_MEMORY.MaxAllocate += BASE_MEMORY_Size(Pointer); ++ free((PVOID) (((PULONG) Pointer) - 1)); + } + } + +@@ -183,7 +182,7 @@ + } + + memcpy(NewPointer, OldPointer, OldSize); +- BASE_MEMORY_FreeCheck(&OldPointer); ++ BASE_MEMORY_FreeCheck(OldPointer); + + if (BASE_MEMORY_MemMax() < MemMaxSize) + { +@@ -193,7 +192,7 @@ + } + + memcpy(OldPointer, NewPointer, OldSize); +- BASE_MEMORY_FreeCheck(&NewPointer); ++ BASE_MEMORY_FreeCheck(NewPointer); + + return OldPointer; + } +diff -urNad unace-nonfree-2.5~/source/base/all/memory/memory.h unace-nonfree-2.5/source/base/all/memory/memory.h +--- unace-nonfree-2.5~/source/base/all/memory/memory.h 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/memory/memory.h 2007-11-22 00:19:02.731662133 +0100 +@@ -32,7 +32,8 @@ + PVOID BASE_MEMORY_GetMemBase2PlusMax(PINT Size, INT Base, INT Maximum, + INT Plus); + +-void BASE_MEMORY_FreeCheck(PVOID *Pointer); ++void BASE_MEMORY_FreeCheck_(PVOID Pointer); ++#define BASE_MEMORY_FreeCheck(ptr) do { BASE_MEMORY_FreeCheck_(ptr); ptr=0; } while(0) + PVOID BASE_MEMORY_ReAlloc(PVOID OldPointer, INT NewSize); + PVOID BASE_MEMORY_ReAllocSameSize(PVOID OldPointer); + void BASE_MEMORY_InitAlloc(void); +diff -urNad unace-nonfree-2.5~/source/base/all/lfn/lin.c unace-nonfree-2.5/source/base/all/lfn/lin.c +--- unace-nonfree-2.5~/source/base/all/lfn/lin.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/lfn/lin.c 2007-11-22 00:19:02.728328838 +0100 +@@ -67,7 +67,7 @@ + } + } + +- BASE_MEMORY_FreeCheck((PVOID*)&Env); ++ BASE_MEMORY_FreeCheck(Env); + } + } + --- unace-nonfree-2.5.orig/debian/patches/04-64bit.dpatch +++ unace-nonfree-2.5/debian/patches/04-64bit.dpatch @@ -0,0 +1,119 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 04-64bit.dpatch by Michael Karcher +## +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Replace declare.h by a generic stdint based version. + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/source/base/all/declare.h unace-nonfree-2.5/source/base/all/declare.h +--- unace-nonfree-2.5~/source/base/all/declare.h 2007-11-06 00:11:47.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/declare.h 2007-11-06 00:13:18.498574104 +0100 +@@ -7,76 +7,47 @@ + #ifndef _DECLARE_H_INCLUDED + #define _DECLARE_H_INCLUDED + +-#if !defined(__OS2__) && !defined(_WINDOWS_) +- typedef int BOOL; +- +- typedef char CHAR; +- typedef unsigned char UCHAR; +- typedef UCHAR *PUCHAR; +- typedef char *PSZ; +- +- typedef short SHORT; +- typedef unsigned short USHORT; +- typedef USHORT *PUSHORT; +- +- typedef long LONG; +- typedef unsigned long ULONG; +- +- typedef ULONG *PULONG; +- +- typedef int INT; +- typedef unsigned int UINT; +- typedef unsigned int *PUINT; ++#include + +- typedef CHAR *LPSTR; +-#endif ++typedef int BOOL; ++typedef BOOL *PBOOL; + +-#if __WATCOMC__==1060 +- typedef long __int64[2]; +- typedef __int64 LONGLONG; +- typedef LONGLONG *PLONGLONG; +- typedef __int64 ULONGLONG; +- typedef ULONGLONG DWORDLONG; +-#else +- #if !defined(_WINDOWS_) +- #if !defined(__WATCOMC__) && !defined(__int64) +- #define __int64 long long +- #endif ++typedef char CHAR; ++typedef CHAR *PCHAR; ++typedef unsigned char UCHAR; ++typedef UCHAR *PUCHAR; ++typedef signed char SCHAR; ++typedef CHAR *PSZ; ++typedef CHAR *LPSTR; + +- typedef __int64 LONGLONG; +- typedef LONGLONG *PLONGLONG; +- typedef unsigned __int64 ULONGLONG; +- typedef ULONGLONG DWORDLONG; +- #endif +-#endif ++typedef int INT; ++typedef INT *PINT; ++typedef unsigned int UINT; ++typedef unsigned int *PUINT; + ++typedef int16_t SHORT; ++typedef SHORT *PSHORT; ++typedef uint16_t USHORT; ++typedef USHORT *PUSHORT; + +-#if !defined(_WINDOWS_) +- typedef BOOL *PBOOL; +- typedef INT *PINT; +-#endif ++typedef int32_t LONG; ++typedef LONG *PLONG; ++typedef uint32_t ULONG; ++typedef ULONG *PULONG; + +-#if !defined(__wtypes_h__) +- typedef void *PVOID; +- typedef CHAR *PCHAR; +- typedef SHORT *PSHORT; +- typedef LONG *PLONG; +- typedef ULONGLONG *PULONGLONG; +-#endif ++typedef int64_t LONGLONG; ++typedef LONGLONG *PLONGLONG; ++typedef uint64_t ULONGLONG; ++typedef ULONGLONG *PULONGLONG; + +-#if defined(_GNU_H_WINDOWS32_BASE) +- typedef LONGLONG ULONGLONG; +- typedef ULONGLONG *PULONGLONG; +-#endif ++typedef void *PVOID; + +-typedef signed char SCHAR; ++/* Dear ACE team, please clean your code to remove the following types */ ++typedef LONGLONG __int64; ++typedef ULONGLONG DWORDLONG; + + #ifndef NULL +- #if defined(__SMALL__) || defined(__MEDIUM__) || defined(__386__) || defined(__AXP__) || defined(__PPC__) +- #define NULL 0 +- #else +- #define NULL 0L +- #endif ++#include + #endif + + --- unace-nonfree-2.5.orig/debian/patches/05-warning-fixes.dpatch +++ unace-nonfree-2.5/debian/patches/05-warning-fixes.dpatch @@ -0,0 +1,304 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 05-warning-fixes.dpatch by Michael Karcher +## +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: This patch fixes harmless warnings, mostly suggested parentheses. + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/source/apps/exe/convert/convert.c unace-nonfree-2.5/source/apps/exe/convert/convert.c +--- unace-nonfree-2.5~/source/apps/exe/convert/convert.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/apps/exe/convert/convert.c 2007-11-22 00:19:02.722167305 +0100 +@@ -109,7 +109,7 @@ + { + UnitCharNumber = 0; + +- while (Size > 999999999 || UnitCharNumber && Size > 99999999) ++ while (Size > 999999999 || (UnitCharNumber && Size > 99999999)) + { + Size >>= 10; + UnitCharNumber++; +diff -urNad unace-nonfree-2.5~/source/apps/exe/messages/messages.c unace-nonfree-2.5/source/apps/exe/messages/messages.c +--- unace-nonfree-2.5~/source/apps/exe/messages/messages.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/apps/exe/messages/messages.c 2007-11-22 00:19:02.722167305 +0100 +@@ -192,7 +192,7 @@ + { + PCHAR AndPos; + +- if (AndPos = strchr(Str, '&')) ++ if ((AndPos = strchr(Str, '&'))) + { + strcpy(AndPos, AndPos + 1); + +diff -urNad unace-nonfree-2.5~/source/apps/unace/exe/commline/commline.c unace-nonfree-2.5/source/apps/unace/exe/commline/commline.c +--- unace-nonfree-2.5~/source/apps/unace/exe/commline/commline.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/apps/unace/exe/commline/commline.c 2007-11-22 00:19:02.724995752 +0100 +@@ -393,7 +395,7 @@ + + void APPS_UNACE_EXE_COMMLINE_ToggleSwitch(PCHAR SwitchChar, PINT Variable) + { +- if (!(*SwitchChar) || *SwitchChar == '+' && *(SwitchChar + 1) == 0) ++ if (!(*SwitchChar) || (*SwitchChar == '+' && *(SwitchChar + 1) == 0)) + { + *Variable = 1; + } +@@ -549,9 +551,9 @@ + if (strrchr(APPS_UNACE_EXE_COMMLINE.WildcardedArchiveName, BASE_PATHFUNC_SEPARATOR) + > PointPos + || !PointPos +- || !BASE_CONVERT_StrICmp(PointPos, ".") +- && !BASE_CONVERT_StrICmp(PointPos, ".ace") +- && !BASE_CONVERT_StrICmp(PointPos, ".exe")) ++ || (!BASE_CONVERT_StrICmp(PointPos, ".") ++ && !BASE_CONVERT_StrICmp(PointPos, ".ace") ++ && !BASE_CONVERT_StrICmp(PointPos, ".exe"))) + { + strcat(APPS_UNACE_EXE_COMMLINE.WildcardedArchiveName, + BASE_ACESTRUC_EXTENSION); +diff -urNad unace-nonfree-2.5~/source/base/all/arcblk/arcblk.c unace-nonfree-2.5/source/base/all/arcblk/arcblk.c +--- unace-nonfree-2.5~/source/base/all/arcblk/arcblk.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/arcblk/arcblk.c 2007-11-22 00:19:02.724995752 +0100 +@@ -117,7 +117,7 @@ + if ((Header->File.HEAD_FLAGS & BASE_ACESTRUC_FLAG_SECURITY) + && (*Size = BASE_ARCBLK_FileHeaderSecuritySize(Header))) + { +- if (*Security = BASE_MEMORY_GetMem(*Size)) ++ if ((*Security = BASE_MEMORY_GetMem(*Size))) + { + memcpy(*Security, BASE_ARCBLK_FileHeaderSecurity(Header), *Size); + } +diff -urNad unace-nonfree-2.5~/source/base/all/archives/test/test.c unace-nonfree-2.5/source/base/all/archives/test/test.c +--- unace-nonfree-2.5~/source/base/all/archives/test/test.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/archives/test/test.c 2007-11-22 00:19:02.724995752 +0100 +@@ -59,7 +59,7 @@ + (PVOID)&BASE_ARCHIVES_TEST.TestBuffer[TestPos], + 512 + 32 -TestPos); + +- if (!Read && !TestPos || errno) ++ if ((!Read && !TestPos) || errno) + { + break; + } +diff -urNad unace-nonfree-2.5~/source/base/all/comments/comments.c unace-nonfree-2.5/source/base/all/comments/comments.c +--- unace-nonfree-2.5~/source/base/all/comments/comments.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/comments/comments.c 2007-11-22 00:19:02.724995752 +0100 +@@ -47,7 +47,11 @@ + CommentSize = sizeof(BASE_COMMENTS.Comment) - 1; + } + +- memcpy(BASE_COMMENTS.Comment, CommentPos, CommentSize); ++ if(CommentSize > 0) ++ { ++ memcpy(BASE_COMMENTS.Comment, CommentPos, CommentSize); ++ } ++ + BASE_COMMENTS.CompressedSize = CommentSize; + BASE_DCPR_COMMENTS_GetComment(); + +diff -urNad unace-nonfree-2.5~/source/base/all/dcpr/dcpr.c unace-nonfree-2.5/source/base/all/dcpr/dcpr.c +--- unace-nonfree-2.5~/source/base/all/dcpr/dcpr.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/dcpr/dcpr.c 2007-11-22 00:19:02.728328838 +0100 +@@ -125,8 +125,8 @@ + RestLen -= R; + } + while ((R || BASE_DCPR.NextType != BASE_DCPR.Type +- || (BASE_DCPR.NextType == BASE_ACESTRUC_BLOCKEDTYPE_LZ77_DELTA) +- && BASE_DCPR_LZ77.NextDeltaLen) ++ || ((BASE_DCPR.NextType == BASE_ACESTRUC_BLOCKEDTYPE_LZ77_DELTA) ++ && BASE_DCPR_LZ77.NextDeltaLen)) + && (RestLen > BASE_CPRDCPR_LZ77_MAXLEN)); + + return Len - RestLen; +diff -urNad unace-nonfree-2.5~/source/base/all/dosfuncs/lin.c unace-nonfree-2.5/source/base/all/dosfuncs/lin.c +--- unace-nonfree-2.5~/source/base/all/dosfuncs/lin.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/dosfuncs/lin.c 2007-11-22 00:19:02.728328838 +0100 +@@ -46,7 +46,7 @@ + { + BASE_PATHFUNC_CompletePath(DirToOpen); + +- if (ChPtr = strrchr(DirToOpen, BASE_PATHFUNC_SEPARATOR)) ++ if ((ChPtr = strrchr(DirToOpen, BASE_PATHFUNC_SEPARATOR))) + { + strcpy(SearchMask, ChPtr + 1); + +diff -urNad unace-nonfree-2.5~/source/base/all/extract/extract.c unace-nonfree-2.5/source/base/all/extract/extract.c +--- unace-nonfree-2.5~/source/base/all/extract/extract.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/extract/extract.c 2007-11-22 00:19:02.728328838 +0100 +@@ -134,7 +134,7 @@ + Decompressed = BASE_DCPR_Block(&Buf[BufPos], BufSize + + BASE_CPRDCPR_LZ77_MAXLEN - BufPos); + +- if (!Decompressed && !BufPos || BASE_ERROR_EXTERN_HandleCancel(1)) ++ if ((!Decompressed && !BufPos) || BASE_ERROR_EXTERN_HandleCancel(1)) + { + break; + } +@@ -265,8 +265,8 @@ + + while (!BASE_ERROR_EXTERN_HandleCancel(1) + && (BASE_EXTRACT.DoExtractAllVolumes +- || BASE_ARCBLK.Options.IsVolume +- && BASE_EXTRACT.DoProcessAllVolumes ++ || (BASE_ARCBLK.Options.IsVolume ++ && BASE_EXTRACT.DoProcessAllVolumes) + || FilesNumber) + && BASE_ARCBLK_LoadBlock()) + { +@@ -348,8 +348,8 @@ + + if (BASE_VOLUME_FirstVolumeToProcess(ArchiveName)) + { +- if (!DoWriteData && BASE_ARCBLK.Options.IsSolid +- || !BASE_FILELIST.Number) ++ if ((!DoWriteData && BASE_ARCBLK.Options.IsSolid) ++ || !BASE_FILELIST.Number) + { + BASE_EXTRACT.DoExtractAllVolumes = 1; + BASE_FILELIST.SizeOfFiles = BASE_DIRDATA_Dir1.UnPackedSize; +diff -urNad unace-nonfree-2.5~/source/base/all/funcs/funcs.c unace-nonfree-2.5/source/base/all/funcs/funcs.c +--- unace-nonfree-2.5~/source/base/all/funcs/funcs.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/funcs/funcs.c 2007-11-22 00:19:02.728328838 +0100 +@@ -24,10 +24,11 @@ + BASE_FILELIST.DoAddFileCheckIfValidFile = + !BASE_DIRDATA_IsInArchive1 && BASE_DIRDATA_IsInArchive2; + +- if (BASE_EXTRACT.DoExtractAllVolumes +- && BASE_FILELIST_Create(1, 5, 1) +- || !BASE_EXTRACT.DoExtractAllVolumes +- && BASE_FILELIST_Create(1, Mode, 1)) ++ if ((BASE_EXTRACT.DoExtractAllVolumes ++ && BASE_FILELIST_Create(1, 5, 1)) ++ || ++ (!BASE_EXTRACT.DoExtractAllVolumes ++ && BASE_FILELIST_Create(1, Mode, 1))) + { + BASE_FUNCS_EXTERN_DoCopy(Mode); + +@@ -45,7 +46,7 @@ + + INT BASE_FUNCS_DeleteRealFile(PCHAR FileName, BOOL IsOverwriteDelete) + { +-BOOL Err; ++BOOL Err = 0; + INT Input; + UINT Attr; + +@@ -76,11 +77,12 @@ + { + BASE_ERROR.ErrorCode = BASE_ERROR_USER; + } +- } +- +- if (Input && !BASE_FUNCS.DoDeleteAll) +- { +- return 1; ++ ++ if (Input > 1) ++ { ++ return 1; ++ } ++ + } + + BASE_LFN_SetFileAttributes(FileName, BASE_DOSFUNCS_NORMAL); +@@ -162,7 +164,7 @@ + INT BASE_FUNCS_CreateDestinationFile(INT Attr) + { + INT Handle, +- Input, ++ Input = 0, + Len; + + sprintf(BASE_STATE.DestinationFileName, "%s%s", +@@ -224,7 +226,7 @@ + } + + BASE_FUNCS.DidNotCopyAll |= +- (Input = (Input && !BASE_FUNCS.DoOverwriteAll ++ (Input = ((Input && !BASE_FUNCS.DoOverwriteAll) + || BASE_FUNCS_DeleteRealFile(BASE_STATE.DestinationFileName, 1))); + + if (Input) +diff -urNad unace-nonfree-2.5~/source/base/all/lfn/lin.c unace-nonfree-2.5/source/base/all/lfn/lin.c +--- unace-nonfree-2.5~/source/base/all/lfn/lin.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/lfn/lin.c 2007-11-22 00:19:02.728328838 +0100 +@@ -50,7 +50,7 @@ + { + SepStr = getenv("PATH"); + +- if (Env = (PCHAR) BASE_MEMORY_GetMem(strlen(SepStr) + 1)) ++ if ((Env = (PCHAR) BASE_MEMORY_GetMem(strlen(SepStr) + 1))) + { + strcpy(Env, SepStr); + SepStr = Env; +diff -urNad unace-nonfree-2.5~/source/base/all/lfn/nont.c unace-nonfree-2.5/source/base/all/lfn/nont.c +--- unace-nonfree-2.5~/source/base/all/lfn/nont.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/lfn/nont.c 2007-11-22 00:19:02.728328838 +0100 +@@ -52,7 +52,7 @@ + + do + { +- if (NextSlashPos = (PCHAR) strchr(NamePos, BASE_PATHFUNC_SEPARATOR)) ++ if ((NextSlashPos = (PCHAR) strchr(NamePos, BASE_PATHFUNC_SEPARATOR))) + { + NameLen = NextSlashPos - NamePos; + } +diff -urNad unace-nonfree-2.5~/source/base/all/memory/nodos32.c unace-nonfree-2.5/source/base/all/memory/nodos32.c +--- unace-nonfree-2.5~/source/base/all/memory/nodos32.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/memory/nodos32.c 2007-11-22 00:19:02.731662133 +0100 +@@ -14,7 +14,7 @@ + + OldSize = BASE_MEMORY_Size(OldPointer); + +- if (NewPointer = realloc((PVOID) ((PULONG) OldPointer - 1), NewSize + 4)) ++ if ((NewPointer = realloc((PVOID) ((PULONG) OldPointer - 1), NewSize + 4))) + { + BASE_MEMORY.MaxAllocate += OldSize - NewSize; + *(PULONG) NewPointer = NewSize; +diff -urNad unace-nonfree-2.5~/source/base/all/pathfunc/pathfunc.c unace-nonfree-2.5/source/base/all/pathfunc/pathfunc.c +--- unace-nonfree-2.5~/source/base/all/pathfunc/pathfunc.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/pathfunc/pathfunc.c 2007-11-22 00:19:02.731662133 +0100 +@@ -140,7 +140,7 @@ + DoRepeat = 0; + strcpy(CompareStr1, SlashPos); + +- if (NextSlashPos = strchr(SlashPos + 1, BASE_PATHFUNC_SEPARATOR)) ++ if ((NextSlashPos = strchr(SlashPos + 1, BASE_PATHFUNC_SEPARATOR))) + { + CompareStr1[NextSlashPos - SlashPos] = 0; + } +@@ -345,11 +345,12 @@ + || !strchr(Path, ':')) + && Path[0] != '/') + */ +- if (Path[0] == '\\' && Path[1] != '\\' +- || Path[0] != BASE_PATHFUNC_SEPARATOR ++ if ((Path[0] == '\\' && Path[1] != '\\') ++ || (Path[0] != BASE_PATHFUNC_SEPARATOR + #ifndef __unix__ + && !strchr(Path, ':') + #endif ++ ) + ) + { + getcwd(CurrentDir, sizeof(CurrentDir)); +@@ -390,7 +391,7 @@ + { + PCHAR Ptr; + +- if (Ptr = strrchr(Path, ':')) ++ if ((Ptr = strrchr(Path, ':'))) + { + return *(Ptr + 1) != '\\'; + } +diff -urNad unace-nonfree-2.5~/source/base/all/state/state.h unace-nonfree-2.5/source/base/all/state/state.h +--- unace-nonfree-2.5~/source/base/all/state/state.h 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/state/state.h 2007-11-22 00:19:02.731662133 +0100 +@@ -54,6 +54,7 @@ + void BASE_STATE_OutputCRCOk(BOOL CRCIsOk); + + void BASE_STATE_EXTERN_IsCRCOk(PBOOL IsCRCOk, BOOL IsEncrypted); ++void BASE_STATE_EXTERN_IsCRCOkSet(PBOOL IsCRCOk, BOOL IsEncrypted); + void BASE_STATE_EXTERN_OutputProgressData(PCHAR Buf, INT Bytes); + + void BASE_STATE_EXTERN_OutputProcess(PCHAR OperationStr, PCHAR FileName, --- unace-nonfree-2.5.orig/debian/patches/03-gcc-call.dpatch +++ unace-nonfree-2.5/debian/patches/03-gcc-call.dpatch @@ -0,0 +1,44 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 03-gcc-call.dpatch by Fabian Greffrath +## and Mike Frysinger . +## +## DP: Call C-Compiler via $(CC), consider CFLAGS, remove -static flag, +## DP: drop linking against libncurses and change include dir order. +## DP: Furthermore use standard env vars and remove pointless -I paths. + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/makefile unace-nonfree-2.5/makefile +--- unace-nonfree-2.5~/makefile 2008-04-09 11:28:30.000000000 +0200 ++++ unace-nonfree-2.5/makefile 2008-04-09 11:28:30.000000000 +0200 +@@ -14,17 +14,16 @@ + SRCSsl = $(BASIC_DIR)source + SRCS = $(SRCSsl)/ + ++ifdef SYSINC + INCLSYSDIR = //usr/include/sys + INCLDIR = //usr/include +- +-DEFINES = -D__LINUX__ -D__unix__ -D__GCC__ -U__HAS_IO_H__ +- +-ifdef DEBUG +-LSWITCHES = ++INCLS = -I$(INCLDIR) -idirafter $(INCLSYSDIR) + else +-LSWITCHES = -Wl,-s ++INCLS = + endif + ++DEFINES = -D__LINUX__ -D__unix__ -D__GCC__ -U__HAS_IO_H__ ++ + ############################################################################## + all: unace + +@@ -47,7 +46,7 @@ + $(APPS_UNACEEXE_CFILES) + + unace: $(UNACEEXELIN_CFILES) +- gcc $(LSWITCHES) -Wl,-lncurses -static -I$(INCLDIR) -I$(INCLSYSDIR) -I$(SRCSsl) $(DEFINES) $(UNACEEXELIN_CFILES) -ggdb -o$(EXECS_DIR)unace ++ $(CC) $(CFLAGS) $(LDFLAGS) $(INCLS) -I$(SRCSsl) $(DEFINES) $(UNACEEXELIN_CFILES) -ggdb -o$(EXECS_DIR)unace + ifndef DEBUG + tar cfvz linunace25.tgz unace file_id.diz licence + #sh linpack.sh --- unace-nonfree-2.5.orig/debian/patches/08-ulonglong-printf.dpatch +++ unace-nonfree-2.5/debian/patches/08-ulonglong-printf.dpatch @@ -0,0 +1,35 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 08-ulonglong-printf.dpatch by Michael Karcher +## +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: This patch fixes a portability issue about printing big numbers. + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/source/apps/exe/convert/convert.c unace-nonfree-2.5/source/apps/exe/convert/convert.c +--- unace-nonfree-2.5~/source/apps/exe/convert/convert.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/apps/exe/convert/convert.c 2007-11-22 00:19:02.722167305 +0100 +@@ -31,7 +31,7 @@ + ByteSize = (ByteSize / 1000000) * 100000000 + (ByteSize / 1000) * 10000 + + ByteSize % 1000; + +- sprintf(Str, "%lld ", ByteSize); ++ sprintf(Str, "%llu ", (unsigned long long)ByteSize); + + StrLen = strlen(Str) - 1; + Str[StrLen] = UNITCHARS[UnitCharNumber]; +@@ -117,12 +117,12 @@ + + if (UnitCharNumber) + { +- sprintf(SizeStr, "%8lld ", Size); ++ sprintf(SizeStr, "%8llu ", (unsigned long long)Size); + SizeStr[strlen(SizeStr) - 1] = UNITCHARS[UnitCharNumber]; + } + else + { +- sprintf(SizeStr, "%9lld", Size); ++ sprintf(SizeStr, "%9llu", (unsigned long long)Size); + } + } + --- unace-nonfree-2.5.orig/debian/patches/12-cast-filetime.dpatch +++ unace-nonfree-2.5/debian/patches/12-cast-filetime.dpatch @@ -0,0 +1,105 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 12-cast-filetime.dpatch by Michael Karcher +## +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Expresses access to bitfield as 32 bit variable using a union to +## DP: not violate the strict aliasing rule. The code is still inherently +## DP: non-portable. + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/source/apps/exe/acefuncs/acefuncs.c unace-nonfree-2.5/source/apps/exe/acefuncs/acefuncs.c +--- unace-nonfree-2.5~/source/apps/exe/acefuncs/acefuncs.c 2007-11-22 01:31:27.000000000 +0100 ++++ unace-nonfree-2.5/source/apps/exe/acefuncs/acefuncs.c 2007-11-22 01:31:43.097911461 +0100 +@@ -33,8 +33,10 @@ + OutputStr[160]; + PCHAR OutputFileName; + INT I; +-tBASE_DOSFUNCS_FileTime +- FileTime; ++union { ++tBASE_DOSFUNCS_FileTime Fields; ++ULONG Raw; ++} FileTime; + + BASE_FILELIST_Init(); + BASE_FILELIST_VolumeCreate(); +@@ -79,7 +81,7 @@ + + APPS_EXE_CONVERT_MakeStrShorter(ShortStr, OutputFileName, 35); + +- *(PULONG) &FileTime = BASE_ARCBLK.Header.File.FTIME; ++ FileTime.Raw = BASE_ARCBLK.Header.File.FTIME; + + BASE_STATE.SummaryUnComprBytes += BASE_ARCBLK.Header.File.SIZE; + BASE_STATE.SummaryComprBytes += BASE_ARCBLK.Header.File.PSIZE; +@@ -87,8 +89,9 @@ + + sprintf( + OutputStr, "%2d.%2d.%2d_%2d:%2d %c%c%s %s %4d%% %c%s", +- FileTime.Day, FileTime.Month, (80 + FileTime.Year) % 100, +- FileTime.Hour, FileTime.Minute, ++ FileTime.Fields.Day, FileTime.Fields.Month, ++ (80 + FileTime.Fields.Year) % 100, ++ FileTime.Fields.Hour, FileTime.Fields.Minute, + BASE_ARCBLK.Header.File.HEAD_FLAGS & BASE_ACESTRUC_FLAG_SPLITBEFORE ? + '\x11' : ' ', + BASE_ARCBLK.Header.File.HEAD_FLAGS & BASE_ACESTRUC_FLAG_SPLITAFTER ? +diff -urNad unace-nonfree-2.5~/source/base/all/archives/ace/ace.c unace-nonfree-2.5/source/base/all/archives/ace/ace.c +--- unace-nonfree-2.5~/source/base/all/archives/ace/ace.c 2007-11-22 01:31:42.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/archives/ace/ace.c 2007-11-22 01:31:43.097911461 +0100 +@@ -183,13 +183,13 @@ + break; + } + +- BASE_ARCHIVES_READ.FileData[BASE_ARCHIVES_READ.FileNumber].Size = ++ BASE_ARCHIVES_READ.FileData[BASE_ARCHIVES_READ.FileNumber].Size = + BASE_ARCBLK.Header.File.SIZE; + +- BASE_ARCHIVES_READ.FileData[BASE_ARCHIVES_READ.FileNumber].PackedSize = ++ BASE_ARCHIVES_READ.FileData[BASE_ARCHIVES_READ.FileNumber].PackedSize = + BASE_ARCBLK.Header.File.PSIZE; + +- BASE_ARCHIVES_READ.FileData[BASE_ARCHIVES_READ.FileNumber].Time = ++ BASE_ARCHIVES_READ.FileData[BASE_ARCHIVES_READ.FileNumber].Time.Fields = + BASE_DOSFUNCS_CalcFileTime(BASE_ARCBLK.Header.File.FTIME); + + Attributes |= +diff -urNad unace-nonfree-2.5~/source/base/all/filelist/filelist.c unace-nonfree-2.5/source/base/all/filelist/filelist.c +--- unace-nonfree-2.5~/source/base/all/filelist/filelist.c 2007-11-22 01:31:42.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/filelist/filelist.c 2007-11-22 01:31:43.101226599 +0100 +@@ -242,7 +242,7 @@ + { + BASE_FILELIST.ListFileData[BASE_FILELIST.Number].Size = FileSize; + +- BASE_FILELIST.ListFileData[BASE_FILELIST.Number].Time = ++ BASE_FILELIST.ListFileData[BASE_FILELIST.Number].Time.Fields = + BASE_DOSFUNCS_CalcFileTime(FileTime); + + if ((BASE_FILELIST.ListFileData[BASE_FILELIST.Number].Attr = Attr) +@@ -397,7 +397,7 @@ + if (BASE_PATHFUNC_WildCardCheck(ListPosition, PureFileName + AddDirLen)) + { + BASE_FILELIST_AddFile(FileName, FileData.Size, +- *(PULONG) &FileData.Time, FileData.Attr); ++ FileData.Time.Raw, FileData.Attr); + + return; + } +diff -urNad unace-nonfree-2.5~/source/base/all/filelist/filelist.h unace-nonfree-2.5/source/base/all/filelist/filelist.h +--- unace-nonfree-2.5~/source/base/all/filelist/filelist.h 2007-11-22 01:31:27.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/filelist/filelist.h 2007-11-22 01:31:43.101226599 +0100 +@@ -31,8 +31,11 @@ + + typedef struct + { +- tBASE_DOSFUNCS_FileTime +- Time; ++ union { ++ tBASE_DOSFUNCS_FileTime ++ Fields; ++ ULONG Raw; ++ } Time; + ULONGLONG + Size, + PackedSize; --- unace-nonfree-2.5.orig/debian/patches/09-utf8-filenames.dpatch +++ unace-nonfree-2.5/debian/patches/09-utf8-filenames.dpatch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 09-utf8-filenames.dpatch by Michael Karcher +## +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: This patch makes unace use utf8 filenames on linux instead of +## DP: Latin1. + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/source/base/all/arcblk/arcblk.c unace-nonfree-2.5/source/base/all/arcblk/arcblk.c +--- unace-nonfree-2.5~/source/base/all/arcblk/arcblk.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/arcblk/arcblk.c 2007-11-22 00:19:02.724995752 +0100 +@@ -282,12 +282,8 @@ + #if defined(__MACOSX__) + BASE_ARCBLK.Header.File.FNAME_SIZE = BASE_UNINORM_CP850ToUTF8NFD( + BASE_ARCBLK.Header.File.FNAME, BASE_ARCBLK.Header.File.FNAME_SIZE); +-#elif defined(__LINUX__) +- /* may not work for every linux user */ +- BASE_ARCBLK.Header.File.FNAME_SIZE = BASE_UNINORM_CP850ToANSI( +- BASE_ARCBLK.Header.File.FNAME, BASE_ARCBLK.Header.File.FNAME_SIZE); + #elif defined(__unix__) +- /* for every other unix assume UTF-8 NFC normalization */ ++ /* for unix, assume UTF-8 NFC normalization */ + BASE_ARCBLK.Header.File.FNAME_SIZE = BASE_UNINORM_CP850ToUTF8NFC( + BASE_ARCBLK.Header.File.FNAME, BASE_ARCBLK.Header.File.FNAME_SIZE); + #endif --- unace-nonfree-2.5.orig/debian/patches/00list +++ unace-nonfree-2.5/debian/patches/00list @@ -0,0 +1,13 @@ +01-only-unace +02-no-io_h +03-gcc-call +04-64bit +05-warning-fixes +06-fix-bad-pointer-arith +07-fix-free-aliasing-issue +08-ulonglong-printf +09-utf8-filenames +10-uninorm-signedness +11-possibly-critical +12-cast-filetime +13-maximum-file-name-length --- unace-nonfree-2.5.orig/debian/patches/10-uninorm-signedness.dpatch +++ unace-nonfree-2.5/debian/patches/10-uninorm-signedness.dpatch @@ -0,0 +1,64 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10-uninorm-signedness.dpatch by Michael Karcher +## +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fixes prototypes in unincore.h to match uninorm.c. + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/source/base/all/uninorm/unincore.h unace-nonfree-2.5/source/base/all/uninorm/unincore.h +--- unace-nonfree-2.5~/source/base/all/uninorm/unincore.h 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/uninorm/unincore.h 2007-11-22 00:19:02.731662133 +0100 +@@ -3,28 +3,30 @@ + * + */ + ++typedef unsigned int uint; ++ + /* integer string functions */ +-int istrlen (int * str ); +-int istrcmp (int * s1, int * s2 ); ++uint istrlen (uint * str ); ++uint istrcmp (uint * s1, uint * s2 ); + + /* unicode data accessors */ +-int is_excluded (int c ); +-int get_combining_class (int c ); +-int get_recombined_codepoint (int c1, int c2 ); +-int * get_decomposition (int * buf, int c ); ++uint is_excluded (uint c ); ++uint get_combining_class (uint c ); ++int get_recombined_codepoint (uint c1, uint c2 ); ++uint * get_decomposition (uint * buf, uint c ); + + /* utf en/decoding functions */ + void encode_utf8(char *buf, unsigned *str); + void decode_utf8(unsigned *buf, char *str); + + /* (de)composition functions */ +-void decompose_recursive (int * buf, int c ); +-void canonical_order (int * str ); +-void canonical_composition (int * str ); +-void canonical_decomposition (int * buf, int * str ); ++void decompose_recursive (uint * buf, uint c ); ++void canonical_order (uint * str ); ++void canonical_composition (uint * str ); ++void canonical_decomposition (uint * buf, uint * str ); + + /* normalization functions */ +-void normalize_nfd (int * buf, int * str ); +-void normalize_nfc (int * buf, int * str ); ++void normalize_nfd (uint * buf, uint * str ); ++void normalize_nfc (uint * buf, uint * str ); + void normalize_nfd_utf8 (char * buf, char * str ); + void normalize_nfc_utf8 (char * buf, char * str ); +diff -urNad unace-nonfree-2.5~/source/base/all/uninorm/uninorm.c unace-nonfree-2.5/source/base/all/uninorm/uninorm.c +--- unace-nonfree-2.5~/source/base/all/uninorm/uninorm.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/uninorm/uninorm.c 2007-11-22 00:19:02.731662133 +0100 +@@ -101,4 +101,4 @@ + } + } + +-*/ +\ No newline at end of file ++*/ --- unace-nonfree-2.5.orig/debian/patches/11-possibly-critical.dpatch +++ unace-nonfree-2.5/debian/patches/11-possibly-critical.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 11-possibly-critical.dpatch by Michael Karcher +## +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fixes a possible security issue by initialising a local variable. + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/source/base/all/dcpr/comments/comments.c unace-nonfree-2.5/source/base/all/dcpr/comments/comments.c +--- unace-nonfree-2.5~/source/base/all/dcpr/comments/comments.c 2007-11-22 00:19:01.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/dcpr/comments/comments.c 2007-11-22 00:19:02.724995752 +0100 +@@ -62,6 +62,8 @@ + + if (BASE_COMMENTS.CompressedSize) + { ++ MatchPos = 0; ++ + CommentPos = 0; + memset(&Hash, 0, sizeof(Hash)); + BASE_DCPR_COMMENTS_Init(); --- unace-nonfree-2.5.orig/debian/patches/02-no-io_h.dpatch +++ unace-nonfree-2.5/debian/patches/02-no-io_h.dpatch @@ -0,0 +1,46 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 02-no-io_h.dpatch by Fabian Greffrath +## +## DP: Not every arch has , include instead. + +@DPATCH@ +diff -urNad unace-nonfree-2.5~/makefile unace-nonfree-2.5/makefile +--- unace-nonfree-2.5~/makefile 2007-11-15 00:06:39.000000000 +0100 ++++ unace-nonfree-2.5/makefile 2007-11-15 00:06:40.355691226 +0100 +@@ -17,7 +17,7 @@ + INCLSYSDIR = //usr/include/sys + INCLDIR = //usr/include + +-DEFINES = -D__LINUX__ -D__unix__ -D__GCC__ -D__HAS_IO_H__ ++DEFINES = -D__LINUX__ -D__unix__ -D__GCC__ -U__HAS_IO_H__ + + ifdef DEBUG + LSWITCHES = +diff -urNad unace-nonfree-2.5~/source/base/all/bufread/bufread.c unace-nonfree-2.5/source/base/all/bufread/bufread.c +--- unace-nonfree-2.5~/source/base/all/bufread/bufread.c 2007-11-15 00:06:39.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/bufread/bufread.c 2007-11-15 00:06:40.355691226 +0100 +@@ -3,6 +3,10 @@ + + #ifdef __HAS_IO_H__ + #include ++#else ++#ifdef __unix__ ++ #include ++#endif + #endif + + #include +diff -urNad unace-nonfree-2.5~/source/base/all/lfn/lfn.h unace-nonfree-2.5/source/base/all/lfn/lfn.h +--- unace-nonfree-2.5~/source/base/all/lfn/lfn.h 2007-11-15 00:06:39.000000000 +0100 ++++ unace-nonfree-2.5/source/base/all/lfn/lfn.h 2007-11-15 00:06:57.995758343 +0100 +@@ -6,6 +6,10 @@ + + #ifdef __HAS_IO_H__ + #include ++#else ++#ifdef __unix__ ++ #include ++#endif + #endif + + #ifdef INCL_BASE_LFN_EXCLUSIVE