[sword-cvs] sword/src/modules/genbook/rawgenbook rawgenbook.cpp,1.9,1.10
sword@www.crosswire.org
sword@www.crosswire.org
Tue, 25 Feb 2003 21:49:15 -0700
Update of /usr/local/cvsroot/sword/src/modules/genbook/rawgenbook
In directory www:/tmp/cvs-serv32606/src/modules/genbook/rawgenbook
Modified Files:
rawgenbook.cpp
Log Message:
no message
Index: rawgenbook.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/genbook/rawgenbook/rawgenbook.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** rawgenbook.cpp 7 Oct 2002 00:14:44 -0000 1.9
--- rawgenbook.cpp 26 Feb 2003 04:49:13 -0000 1.10
***************
*** 38,42 ****
char *buf = new char [ strlen (ipath) + 20 ];
- entryBuf = 0;
path = 0;
stdstr(&path, ipath);
--- 38,41 ----
***************
*** 69,74 ****
delete [] path;
- if (entryBuf)
- delete [] entryBuf;
}
--- 68,71 ----
***************
*** 81,85 ****
*/
! char *RawGenBook::getRawEntry() {
__u32 offset = 0;
--- 78,82 ----
*/
! SWBuf &RawGenBook::getRawEntryBuf() {
__u32 offset = 0;
***************
*** 97,105 ****
}
- if (entryBuf)
- delete [] entryBuf;
-
int dsize;
key->getUserData(&dsize);
if (dsize > 7) {
memcpy(&offset, key->getUserData(), 4);
--- 94,100 ----
}
int dsize;
key->getUserData(&dsize);
+ entryBuf = "";
if (dsize > 7) {
memcpy(&offset, key->getUserData(), 4);
***************
*** 111,131 ****
entrySize = size; // support getEntrySize call
! entryBuf = new char [ (size + 2) * FILTERPAD ];
! *entryBuf = 0;
lseek(bdtfd->getFd(), offset, SEEK_SET);
! read(bdtfd->getFd(), entryBuf, size);
! entryBuf[size] = 0;
! rawFilter(entryBuf, size, 0); // hack, decipher
! rawFilter(entryBuf, size*FILTERPAD, key);
if (!isUnicode())
! RawStr::preptext(entryBuf);
! }
! else {
! entryBuf = new char [2];
! entryBuf[0] = 0;
! entryBuf[1] = 0;
! entrySize = 0;
}
--- 106,119 ----
entrySize = size; // support getEntrySize call
! entryBuf.setFillByte(0);
! entryBuf.setSize(size);
lseek(bdtfd->getFd(), offset, SEEK_SET);
! read(bdtfd->getFd(), entryBuf.getRawData(), size);
! rawFilter(entryBuf, 0); // hack, decipher
! rawFilter(entryBuf, key);
if (!isUnicode())
! RawStr::prepText(entryBuf);
}