From b425e28b5cfc9ef2de3a333fcc398b860afb347c Mon Sep 17 00:00:00 2001 From: danglassey Date: Tue, 8 Oct 2002 13:02:28 +0000 Subject: sync with crosswire 20021008-1300 --- ChangeLog | 20 ++++++--- apps/console/diatheke/corediatheke.cpp | 5 ++- apps/windoze/CBuilder5/BibleCS/sword.bpr | 22 +++++----- apps/windoze/CBuilder5/BibleCS/sword.res | Bin 1972 -> 1972 bytes apps/windoze/CBuilder5/BibleCS/swordlib.bpr | 16 ++++---- apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpg | 6 +-- apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr | 24 +++++------ apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp | 1 - apps/windoze/CBuilder5/InstallMgr/InstallMgr.res | Bin 1852 -> 1856 bytes apps/windoze/CBuilder5/InstallMgr/StatusFrm.dfm | Bin 1510 -> 1511 bytes apps/windoze/CBuilder5/InstallMgr/installmgr.conf | 1 + apps/windoze/CBuilder5/InstallMgr/zlib.bpr | 13 +++--- include/defs.h | 2 +- include/swversion.h | 4 +- include/zconf.h | 4 +- include/zlib.h | 6 +-- src/keys/treekeyidx.cpp | 24 ++++++----- src/utilfuns/zlib/adler32.c | 4 +- src/utilfuns/zlib/compress.c | 4 +- src/utilfuns/zlib/crc32.c | 4 +- src/utilfuns/zlib/deflate.c | 8 ++-- src/utilfuns/zlib/deflate.h | 4 +- src/utilfuns/zlib/gzio.c | 4 +- src/utilfuns/zlib/infblock.c | 11 +++-- src/utilfuns/zlib/infblock.h | 2 +- src/utilfuns/zlib/infcodes.c | 19 +++------ src/utilfuns/zlib/infcodes.h | 2 +- src/utilfuns/zlib/inffast.c | 47 ++++++++++++++-------- src/utilfuns/zlib/inffast.h | 2 +- src/utilfuns/zlib/inflate.c | 2 +- src/utilfuns/zlib/inftrees.c | 9 ++--- src/utilfuns/zlib/inftrees.h | 2 +- src/utilfuns/zlib/infutil.c | 2 +- src/utilfuns/zlib/infutil.h | 2 +- src/utilfuns/zlib/maketree.c | 2 +- src/utilfuns/zlib/trees.c | 4 +- src/utilfuns/zlib/uncompr.c | 4 +- src/utilfuns/zlib/zutil.c | 4 +- src/utilfuns/zlib/zutil.h | 4 +- 39 files changed, 154 insertions(+), 140 deletions(-) diff --git a/ChangeLog b/ChangeLog index e313864..3fd90d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,17 +1,25 @@ API ChangeLog (see the ChangeLog in each 'apps' directory for app specific changes -01-Oct-2002 Daniel Glassey - work on sword swig perl binding + +* Release 1.5.4a * + +07-Oct-2002 Troy A. Griffitts + Fixed rawFilter bug where entrySize was being passed + instead of maxBufferSize. This problem caused + a number of problems with the engine. + Applied a few of Franklin Bratcher's critical patches + to diatheke. 01-Oct-2002 Daniel Glassey - change sword to use a sword namespace - fix to build with gcc3.2 again after yesterday + Work on sword swig perl binding + Change sword to use a sword namespace + Fix to build with gcc3.2 again after yesterday 30-Sep-2002 Daniel Glassey - remove using namespace std from all headers + Remove using namespace std from all headers -28-Sep-2002 Troy A. Griffitts +28-Sep-2002 Troy A. Griffitts Added SWModule::Index and SWCom and SWText impls diff --git a/apps/console/diatheke/corediatheke.cpp b/apps/console/diatheke/corediatheke.cpp index 6c32bbe..3b43450 100644 --- a/apps/console/diatheke/corediatheke.cpp +++ b/apps/console/diatheke/corediatheke.cpp @@ -5,6 +5,7 @@ // see accompanying LICENSE file for license details #include "corediatheke.h" +#include #include #include #include @@ -219,7 +220,7 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI querytype = QT_LD; //do search stuff - searchtype = 1 - searchtype; + char st = 1 - searchtype; if (querytype == QT_BIBLE) { *output << "Verses containing \""; } @@ -227,7 +228,7 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI *output << ref; *output << "\"-- "; - listkey = target->Search(ref, searchtype); + listkey = target->Search(ref, st, REG_ICASE); if (strlen((const char*)listkey)) { if (!listkey.Error()) { diff --git a/apps/windoze/CBuilder5/BibleCS/sword.bpr b/apps/windoze/CBuilder5/BibleCS/sword.bpr index 5627534..ac9ee50 100644 --- a/apps/windoze/CBuilder5/BibleCS/sword.bpr +++ b/apps/windoze/CBuilder5/BibleCS/sword.bpr @@ -43,7 +43,7 @@ - + @@ -55,16 +55,16 @@ - - + + - - + + - + [Version Info] @@ -73,7 +73,7 @@ AutoIncBuild=1 MajorVer=1 MinorVer=5 Release=4 -Build=129 +Build=130 Debug=0 PreRelease=0 Special=0 @@ -85,7 +85,7 @@ CodePage=1252 [Version Info Keys] CompanyName=CrossWire Software & Bible Society FileDescription=Windows 32bit User Interface to The SWORD Project -FileVersion=1.5.4.129 +FileVersion=1.5.4.130 InternalName=biblecs LegalCopyright=(c) 2002 CrossWire Bible Society under the terms of the GNU General Public License LegalTrademarks= @@ -125,8 +125,8 @@ Item0=$(BCB)\source\vcl [HistoryLists\hlConditionals] Count=8 -Item0=_ICU_;_ICUSWORD_;USBINARY;_DEBUG -Item1=_ICU_;_ICUSWORD_;USBINARY +Item0=_ICU_;_ICUSWORD_;USBINARY +Item1=_ICU_;_ICUSWORD_;USBINARY;_DEBUG Item2=_ICU_;_ICUSWORD_;_DEBUG;USBINARY Item3=_ICU_;_ICUSWORD_;_DEBUG Item4=_ICU_;_ICUSWORD_ @@ -159,7 +159,7 @@ RemoteDebug=0 [Compiler] ShowInfoMsgs=0 LinkDebugVcl=0 -LinkCGLIB=1 +LinkCGLIB=0 [Language] ActiveLang= diff --git a/apps/windoze/CBuilder5/BibleCS/sword.res b/apps/windoze/CBuilder5/BibleCS/sword.res index 6dd7c05..9adcbc3 100644 Binary files a/apps/windoze/CBuilder5/BibleCS/sword.res and b/apps/windoze/CBuilder5/BibleCS/sword.res differ diff --git a/apps/windoze/CBuilder5/BibleCS/swordlib.bpr b/apps/windoze/CBuilder5/BibleCS/swordlib.bpr index a280a48..9978ead 100644 --- a/apps/windoze/CBuilder5/BibleCS/swordlib.bpr +++ b/apps/windoze/CBuilder5/BibleCS/swordlib.bpr @@ -78,7 +78,7 @@ - + @@ -107,11 +107,11 @@ -I..\..\..\..\src\modules\comments\rawcom -I..\..\..\..\src\mgr -I..\..\..\..\src\keys -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -D_ICU_ -D_DEBUG"/> - - + + - + @@ -163,8 +163,8 @@ Item5=..\..\..\..\src\modules\lexdict\zld;..\..;..\..\..\..\src\utilfuns\zlib;.. [HistoryLists\hlConditionals] Count=8 -Item0=_ICU_;_ICUSWORD_;USBINARY;_DEBUG -Item1=_ICU_;_ICUSWORD_;USBINARY +Item0=_ICU_;_ICUSWORD_;USBINARY +Item1=_ICU_;_ICUSWORD_;USBINARY;_DEBUG Item2=_ICU_;_ICUSWORD_;_DEBUG;USBINARY Item3=_ICU_;_ICUSWORD_;_DEBUG Item4=_ICU_;_ICUSWORD_ @@ -200,7 +200,7 @@ RemoteDebug=0 [Compiler] ShowInfoMsgs=0 LinkDebugVcl=0 -LinkCGLIB=1 +LinkCGLIB=0 [Language] ActiveLang= diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpg b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpg index 792eb7c..33413a8 100644 --- a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpg +++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpg @@ -9,7 +9,7 @@ MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** DCC = $(ROOT)\bin\dcc32.exe $** BRCC = $(ROOT)\bin\brcc32.exe $** #------------------------------------------------------------------------------ -PROJECTS = swordlib.lib zlib.lib libcurl.lib InstallMgr.exe +PROJECTS = swordlib.lib libcurl.lib InstallMgr.exe #------------------------------------------------------------------------------ default: $(PROJECTS) #------------------------------------------------------------------------------ @@ -20,10 +20,6 @@ InstallMgr.exe: InstallMgr.bpr swordlib.lib: ..\BibleCS\swordlib.bpr $(MAKE) -zlib.lib: zlib.bpr - $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $** - $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak - libcurl.lib: libcurl.bpr $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $** $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr index 5ac73fc..e91fc4b 100644 --- a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr +++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr @@ -12,7 +12,7 @@ - @@ -28,7 +28,7 @@ - + @@ -40,17 +40,17 @@ - - + + - - + + - + [Version Info] @@ -77,7 +77,7 @@ LegalCopyright=Copyright 2002 by CrossWire Bible Society LegalTrademarks= OriginalFilename= ProductName=The SWORD Project -ProductVersion=1.5.4 +ProductVersion=1.5.4a Comments=Seek Jesus who exchanges temporary for eternal [HistoryLists\hlIncludePath] @@ -103,8 +103,8 @@ Item0=$(BCB)\source\vcl [HistoryLists\hlConditionals] Count=10 -Item0=VCL;_ICU_;_ICUSWORD_;USBINARY;_DEBUG -Item1=VCL;_ICU_;_ICUSWORD_;USBINARY +Item0=VCL;_ICU_;_ICUSWORD_;USBINARY +Item1=VCL;_ICU_;_ICUSWORD_;USBINARY;_DEBUG Item2=VCL Item3=VCL;_DEBUG Item4=VCL;__STDC__ true @@ -131,7 +131,7 @@ RemoteDebug=0 [Compiler] ShowInfoMsgs=0 LinkDebugVcl=0 -LinkCGLIB=1 +LinkCGLIB=0 [Language] ActiveLang= diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp index ce79815..ae345b6 100644 --- a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp +++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp @@ -8,7 +8,6 @@ USEFORM("RemoteMntFrm.cpp", RemoteMntForm); USEFORM("InfoFrm.cpp", InfoForm); USEFORM("cipherfrm.cpp", CipherForm); USEFORM("UninstallFrm.cpp", UninstallForm); -USELIB("zlib.lib"); USELIB("..\..\..\..\lib\swordlib.lib"); USELIB("libcurl.lib"); USELIB("curl\lib\ws2_32.lib"); diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.res b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.res index a67dc92..e1236ba 100644 Binary files a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.res and b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.res differ diff --git a/apps/windoze/CBuilder5/InstallMgr/StatusFrm.dfm b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.dfm index 4d009c4..a139ac2 100644 Binary files a/apps/windoze/CBuilder5/InstallMgr/StatusFrm.dfm and b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.dfm differ diff --git a/apps/windoze/CBuilder5/InstallMgr/installmgr.conf b/apps/windoze/CBuilder5/InstallMgr/installmgr.conf index 5002470..fd15db9 100644 --- a/apps/windoze/CBuilder5/InstallMgr/installmgr.conf +++ b/apps/windoze/CBuilder5/InstallMgr/installmgr.conf @@ -5,5 +5,6 @@ PassiveFTP=true [Sources] FTPSource=crosswire|ftp.crosswire.org|/pub/sword/raw/ FTPSource=host|192.168.32.123|/pub/sword +FTPSource=CrossWire Beta|sword.cx|/pub/sword/betaraw/ LocalPath= diff --git a/apps/windoze/CBuilder5/InstallMgr/zlib.bpr b/apps/windoze/CBuilder5/InstallMgr/zlib.bpr index 04abf33..529900f 100644 --- a/apps/windoze/CBuilder5/InstallMgr/zlib.bpr +++ b/apps/windoze/CBuilder5/InstallMgr/zlib.bpr @@ -33,7 +33,7 @@ - + @@ -44,15 +44,14 @@ - - - + + + - + [Version Info] @@ -112,7 +111,7 @@ RemoteDebug=0 [Compiler] ShowInfoMsgs=0 LinkDebugVcl=0 -LinkCGLIB=1 +LinkCGLIB=0 [Language] ActiveLang= diff --git a/include/defs.h b/include/defs.h index db5809e..2ceb73f 100644 --- a/include/defs.h +++ b/include/defs.h @@ -15,7 +15,7 @@ SWORD_NAMESPACE_START -#define FILTERPAD 80 +#define FILTERPAD 16 #if defined(__SWMSW__) diff --git a/include/swversion.h b/include/swversion.h index 20f723d..09cf0fe 100644 --- a/include/swversion.h +++ b/include/swversion.h @@ -1,7 +1,7 @@ /****************************************************************************** * swversion.h - definition of class SWVersion used to compare version info * - * $Id: swversion.h,v 1.7 2002/10/02 23:43:43 dglassey Exp $ + * $Id: swversion.h,v 1.8 2002/10/08 02:03:31 scribe Exp $ * * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society @@ -20,7 +20,7 @@ */ #ifndef SWORDVER -#define SWORDVER "1.5.5" +#define SWORDVER "1.5.4a" #endif #ifndef SWVERSION_H diff --git a/include/zconf.h b/include/zconf.h index 85fc50c..59f0c73 100644 --- a/include/zconf.h +++ b/include/zconf.h @@ -1,9 +1,9 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: zconf.h,v 1.1 2001/03/23 09:00:15 scribe Exp $ */ +/* @(#) $Id: zconf.h,v 1.3 2002/10/07 22:48:50 scribe Exp $ */ #ifndef _ZCONF_H #define _ZCONF_H diff --git a/include/zlib.h b/include/zlib.h index 49f56b4..52cb529 100644 --- a/include/zlib.h +++ b/include/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.1.3, July 9th, 1998 + version 1.1.4, March 11th, 2002 - Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,7 +37,7 @@ extern "C" { #endif -#define ZLIB_VERSION "1.1.3" +#define ZLIB_VERSION "1.1.4" /* The 'zlib' compression library provides in-memory compression and diff --git a/src/keys/treekeyidx.cpp b/src/keys/treekeyidx.cpp index d5d32fe..e12a458 100644 --- a/src/keys/treekeyidx.cpp +++ b/src/keys/treekeyidx.cpp @@ -1,7 +1,7 @@ /****************************************************************************** * versekey.h - code for class 'versekey'- a standard Biblical verse key * - * $Id: treekeyidx.cpp,v 1.11 2002/10/01 22:04:58 dglassey Exp $ + * $Id: treekeyidx.cpp,v 1.12 2002/10/08 00:36:00 scribe Exp $ * * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society @@ -337,27 +337,29 @@ void TreeKeyIdx::getTreeNodeFromDatOffset(long ioffset, TreeNode *node) const { char TreeKeyIdx::getTreeNodeFromIdxOffset(long ioffset, TreeNode *node) const { __u32 offset; - char error = 0; + char error = KEYERR_OUTOFBOUNDS; if (ioffset < 0) { ioffset = 0; - error = KEYERR_OUTOFBOUNDS; + error = 7777; // out of bounds but still position to 0; } node->offset = ioffset; if (idxfd > 0) { - lseek(idxfd->getFd(), ioffset, SEEK_SET); - if (read(idxfd->getFd(), &offset, 4) == 4) { - offset = swordtoarch32(offset); - getTreeNodeFromDatOffset(offset, node); - } - else { - lseek(idxfd->getFd(), -4, SEEK_END); + if (idxfd->getFd() > 0) { + lseek(idxfd->getFd(), ioffset, SEEK_SET); if (read(idxfd->getFd(), &offset, 4) == 4) { offset = swordtoarch32(offset); + error = (error == 7777) ? KEYERR_OUTOFBOUNDS : 0; getTreeNodeFromDatOffset(offset, node); } - error = KEYERR_OUTOFBOUNDS; + else { + lseek(idxfd->getFd(), -4, SEEK_END); + if (read(idxfd->getFd(), &offset, 4) == 4) { + offset = swordtoarch32(offset); + getTreeNodeFromDatOffset(offset, node); + } + } } } return error; diff --git a/src/utilfuns/zlib/adler32.c b/src/utilfuns/zlib/adler32.c index 14e3abd..f29cf42 100644 --- a/src/utilfuns/zlib/adler32.c +++ b/src/utilfuns/zlib/adler32.c @@ -1,9 +1,9 @@ /* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: adler32.c,v 1.1 2001/03/23 09:00:15 scribe Exp $ */ +/* @(#) $Id: adler32.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */ #include "zlib.h" diff --git a/src/utilfuns/zlib/compress.c b/src/utilfuns/zlib/compress.c index df5fca8..8562957 100644 --- a/src/utilfuns/zlib/compress.c +++ b/src/utilfuns/zlib/compress.c @@ -1,9 +1,9 @@ /* compress.c -- compress a memory buffer - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: compress.c,v 1.1 2001/03/23 09:00:15 scribe Exp $ */ +/* @(#) $Id: compress.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */ #include "zlib.h" diff --git a/src/utilfuns/zlib/crc32.c b/src/utilfuns/zlib/crc32.c index fe80e8a..8577b4a 100644 --- a/src/utilfuns/zlib/crc32.c +++ b/src/utilfuns/zlib/crc32.c @@ -1,9 +1,9 @@ /* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: crc32.c,v 1.1 2001/03/23 09:00:15 scribe Exp $ */ +/* @(#) $Id: crc32.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */ #include "zlib.h" diff --git a/src/utilfuns/zlib/deflate.c b/src/utilfuns/zlib/deflate.c index a232eea..1d26f37 100644 --- a/src/utilfuns/zlib/deflate.c +++ b/src/utilfuns/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -47,12 +47,12 @@ * */ -/* @(#) $Id: deflate.c,v 1.1 2001/03/23 09:00:15 scribe Exp $ */ +/* @(#) $Id: deflate.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.1.3 Copyright 1995-1998 Jean-loup Gailly "; + " deflate 1.1.4 Copyright 1995-2002 Jean-loup Gailly "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -242,7 +242,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, windowBits = -windowBits; } if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || - windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + windowBits < 9 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_HUFFMAN_ONLY) { return Z_STREAM_ERROR; } diff --git a/src/utilfuns/zlib/deflate.h b/src/utilfuns/zlib/deflate.h index e55d52a..64f6345 100644 --- a/src/utilfuns/zlib/deflate.h +++ b/src/utilfuns/zlib/deflate.h @@ -1,5 +1,5 @@ /* deflate.h -- internal compression state - * Copyright (C) 1995-1998 Jean-loup Gailly + * Copyright (C) 1995-2002 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -8,7 +8,7 @@ subject to change. Applications should only use zlib.h. */ -/* @(#) $Id: deflate.h,v 1.1 2001/03/23 09:00:15 scribe Exp $ */ +/* @(#) $Id: deflate.h,v 1.2 2002/10/07 22:28:15 scribe Exp $ */ #ifndef _DEFLATE_H #define _DEFLATE_H diff --git a/src/utilfuns/zlib/gzio.c b/src/utilfuns/zlib/gzio.c index a2c5b58..645dae1 100644 --- a/src/utilfuns/zlib/gzio.c +++ b/src/utilfuns/zlib/gzio.c @@ -1,11 +1,11 @@ /* gzio.c -- IO on .gz files - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h * * Compile this file with -DNO_DEFLATE to avoid the compression code. */ -/* @(#) $Id: gzio.c,v 1.1 2001/03/23 09:00:15 scribe Exp $ */ +/* @(#) $Id: gzio.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */ #include diff --git a/src/utilfuns/zlib/infblock.c b/src/utilfuns/zlib/infblock.c index f4920fa..dd7a6d4 100644 --- a/src/utilfuns/zlib/infblock.c +++ b/src/utilfuns/zlib/infblock.c @@ -1,5 +1,5 @@ /* infblock.c -- interpret and process block types to last block - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -249,10 +249,12 @@ int r; &s->sub.trees.tb, s->hufts, z); if (t != Z_OK) { - ZFREE(z, s->sub.trees.blens); r = t; if (r == Z_DATA_ERROR) + { + ZFREE(z, s->sub.trees.blens); s->mode = BAD; + } LEAVE } s->sub.trees.index = 0; @@ -313,11 +315,13 @@ int r; t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), s->sub.trees.blens, &bl, &bd, &tl, &td, s->hufts, z); - ZFREE(z, s->sub.trees.blens); if (t != Z_OK) { if (t == (uInt)Z_DATA_ERROR) + { + ZFREE(z, s->sub.trees.blens); s->mode = BAD; + } r = t; LEAVE } @@ -329,6 +333,7 @@ int r; } s->sub.decode.codes = c; } + ZFREE(z, s->sub.trees.blens); s->mode = CODES; case CODES: UPDATE diff --git a/src/utilfuns/zlib/infblock.h b/src/utilfuns/zlib/infblock.h index bd25c80..173b226 100644 --- a/src/utilfuns/zlib/infblock.h +++ b/src/utilfuns/zlib/infblock.h @@ -1,5 +1,5 @@ /* infblock.h -- header to use infblock.c - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ diff --git a/src/utilfuns/zlib/infcodes.c b/src/utilfuns/zlib/infcodes.c index cfd0807..9abe541 100644 --- a/src/utilfuns/zlib/infcodes.c +++ b/src/utilfuns/zlib/infcodes.c @@ -1,5 +1,5 @@ /* infcodes.c -- process literals and length/distance pairs - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -94,8 +94,7 @@ int r; uInt m; /* bytes to end of window or read pointer */ Bytef *f; /* pointer to copy strings from */ inflate_codes_statef *c = s->sub.decode.codes; /* codes state */ - long tryF; -// f = q + /* copy input/output information to locals (UPDATE macro restores) */ LOAD @@ -197,17 +196,9 @@ int r; Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist)); c->mode = COPY; case COPY: /* o: copying bytes in window, waiting for space */ -#ifndef __TURBOC__ /* Turbo C bug for following expression */ - f = (uInt)(q - s->window) < c->sub.copy.dist ? - s->end - (c->sub.copy.dist - (q - s->window)) : - q - c->sub.copy.dist; -#else - tryF = (long)q - c->sub.copy.dist; -// f = q - c->sub.copy.dist; - if ((uInt)(q - s->window) < c->sub.copy.dist) - f = s->end - (c->sub.copy.dist - (uInt)(q - s->window)); - else f = (Bytef *)tryF; -#endif + f = q - c->sub.copy.dist; + while (f < s->window) /* modulo window size-"while" instead */ + f += s->end - s->window; /* of "if" handles invalid distances */ while (c->len) { NEEDOUT diff --git a/src/utilfuns/zlib/infcodes.h b/src/utilfuns/zlib/infcodes.h index 6c750d8..46821a0 100644 --- a/src/utilfuns/zlib/infcodes.h +++ b/src/utilfuns/zlib/infcodes.h @@ -1,5 +1,5 @@ /* infcodes.h -- header to use infcodes.c - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ diff --git a/src/utilfuns/zlib/inffast.c b/src/utilfuns/zlib/inffast.c index 61a78ee..aa7f1d4 100644 --- a/src/utilfuns/zlib/inffast.c +++ b/src/utilfuns/zlib/inffast.c @@ -1,5 +1,5 @@ /* inffast.c -- process literals and length/distance pairs fast - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -93,28 +93,41 @@ z_streamp z; /* do the copy */ m -= c; - if ((uInt)(q - s->window) >= d) /* offset before dest */ - { /* just copy */ - r = q - d; - *q++ = *r++; c--; /* minimum count is three, */ - *q++ = *r++; c--; /* so unroll loop a little */ - } - else /* else offset after destination */ + r = q - d; + if (r < s->window) /* wrap if needed */ { - e = d - (uInt)(q - s->window); /* bytes from offset to end */ - r = s->end - e; /* pointer to offset */ - if (c > e) /* if source crosses, */ + do { + r += s->end - s->window; /* force pointer in window */ + } while (r < s->window); /* covers invalid distances */ + e = s->end - r; + if (c > e) { - c -= e; /* copy to end of window */ + c -= e; /* wrapped copy */ do { - *q++ = *r++; + *q++ = *r++; } while (--e); - r = s->window; /* copy rest from start of window */ + r = s->window; + do { + *q++ = *r++; + } while (--c); } + else /* normal copy */ + { + *q++ = *r++; c--; + *q++ = *r++; c--; + do { + *q++ = *r++; + } while (--c); + } + } + else /* normal copy */ + { + *q++ = *r++; c--; + *q++ = *r++; c--; + do { + *q++ = *r++; + } while (--c); } - do { /* copy all or what's left */ - *q++ = *r++; - } while (--c); break; } else if ((e & 64) == 0) diff --git a/src/utilfuns/zlib/inffast.h b/src/utilfuns/zlib/inffast.h index 8facec5..a31a4bb 100644 --- a/src/utilfuns/zlib/inffast.h +++ b/src/utilfuns/zlib/inffast.h @@ -1,5 +1,5 @@ /* inffast.h -- header to use inffast.c - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ diff --git a/src/utilfuns/zlib/inflate.c b/src/utilfuns/zlib/inflate.c index 32e9b8d..dfb2e86 100644 --- a/src/utilfuns/zlib/inflate.c +++ b/src/utilfuns/zlib/inflate.c @@ -1,5 +1,5 @@ /* inflate.c -- zlib interface to inflate modules - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ diff --git a/src/utilfuns/zlib/inftrees.c b/src/utilfuns/zlib/inftrees.c index ef1e0b6..4c32ca3 100644 --- a/src/utilfuns/zlib/inftrees.c +++ b/src/utilfuns/zlib/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -11,7 +11,7 @@ #endif const char inflate_copyright[] = - " inflate 1.1.3 Copyright 1995-1998 Mark Adler "; + " inflate 1.1.4 Copyright 1995-2002 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -104,8 +104,7 @@ uIntf *v; /* working area: values in order of bit length */ /* Given a list of code lengths and a maximum table size, make a set of tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR if the given code set is incomplete (the tables are still built in this - case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of - lengths), or Z_MEM_ERROR if not enough memory. */ + case), or Z_DATA_ERROR if the input is invalid. */ { uInt a; /* counter for codes of length k */ @@ -231,7 +230,7 @@ uIntf *v; /* working area: values in order of bit length */ /* allocate new table */ if (*hn + z > MANY) /* (note: doesn't matter for fixed) */ - return Z_MEM_ERROR; /* not enough memory */ + return Z_DATA_ERROR; /* overflow of MANY */ u[h] = q = hp + *hn; *hn += z; diff --git a/src/utilfuns/zlib/inftrees.h b/src/utilfuns/zlib/inftrees.h index 85853e0..04b73b7 100644 --- a/src/utilfuns/zlib/inftrees.h +++ b/src/utilfuns/zlib/inftrees.h @@ -1,5 +1,5 @@ /* inftrees.h -- header to use inftrees.c - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ diff --git a/src/utilfuns/zlib/infutil.c b/src/utilfuns/zlib/infutil.c index 824dab5..9a07622 100644 --- a/src/utilfuns/zlib/infutil.c +++ b/src/utilfuns/zlib/infutil.c @@ -1,5 +1,5 @@ /* inflate_util.c -- data and routines common to blocks and codes - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ diff --git a/src/utilfuns/zlib/infutil.h b/src/utilfuns/zlib/infutil.h index 99d1135..4401df8 100644 --- a/src/utilfuns/zlib/infutil.h +++ b/src/utilfuns/zlib/infutil.h @@ -1,5 +1,5 @@ /* infutil.h -- types and macros common to blocks and codes - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ diff --git a/src/utilfuns/zlib/maketree.c b/src/utilfuns/zlib/maketree.c index 949d786..a16d4b1 100644 --- a/src/utilfuns/zlib/maketree.c +++ b/src/utilfuns/zlib/maketree.c @@ -1,5 +1,5 @@ /* maketree.c -- make inffixed.h table for decoding fixed codes - * Copyright (C) 1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ diff --git a/src/utilfuns/zlib/trees.c b/src/utilfuns/zlib/trees.c index 4d59d6e..52c33f1 100644 --- a/src/utilfuns/zlib/trees.c +++ b/src/utilfuns/zlib/trees.c @@ -1,5 +1,5 @@ /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-1998 Jean-loup Gailly + * Copyright (C) 1995-2002 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -29,7 +29,7 @@ * Addison-Wesley, 1983. ISBN 0-201-06672-6. */ -/* @(#) $Id: trees.c,v 1.1 2001/03/23 09:00:15 scribe Exp $ */ +/* @(#) $Id: trees.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */ /* #define GEN_TREES_H */ diff --git a/src/utilfuns/zlib/uncompr.c b/src/utilfuns/zlib/uncompr.c index 0c1051a..42492a7 100644 --- a/src/utilfuns/zlib/uncompr.c +++ b/src/utilfuns/zlib/uncompr.c @@ -1,9 +1,9 @@ /* uncompr.c -- decompress a memory buffer - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: uncompr.c,v 1.1 2001/03/23 09:00:15 scribe Exp $ */ +/* @(#) $Id: uncompr.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */ #include "zlib.h" diff --git a/src/utilfuns/zlib/zutil.c b/src/utilfuns/zlib/zutil.c index 2eb7b46..e1c7a6c 100644 --- a/src/utilfuns/zlib/zutil.c +++ b/src/utilfuns/zlib/zutil.c @@ -1,9 +1,9 @@ /* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: zutil.c,v 1.1 2001/03/23 09:00:15 scribe Exp $ */ +/* @(#) $Id: zutil.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */ #include "zutil.h" diff --git a/src/utilfuns/zlib/zutil.h b/src/utilfuns/zlib/zutil.h index 53278ba..bd6348d 100644 --- a/src/utilfuns/zlib/zutil.h +++ b/src/utilfuns/zlib/zutil.h @@ -1,5 +1,5 @@ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -8,7 +8,7 @@ subject to change. Applications should only use zlib.h. */ -/* @(#) $Id: zutil.h,v 1.1 2001/03/23 09:00:15 scribe Exp $ */ +/* @(#) $Id: zutil.h,v 1.2 2002/10/07 22:28:15 scribe Exp $ */ #ifndef _Z_UTIL_H #define _Z_UTIL_H -- cgit