pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/misc/sword Don't try to order pointers, check for NULL...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/63fb54a79c4c
branches:  trunk
changeset: 356027:63fb54a79c4c
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sat Dec 17 14:22:39 2016 +0000

description:
Don't try to order pointers, check for NULLness.

diffstat:

 misc/sword/distinfo                                            |  10 +-
 misc/sword/patches/patch-src_keys_treekeyidx.cpp               |  49 ++++++++++
 misc/sword/patches/patch-src_mgr_swmgr.cpp                     |  13 ++
 misc/sword/patches/patch-src_modules_common_rawstr.cpp         |  31 ++++++
 misc/sword/patches/patch-src_modules_common_rawstr4.cpp        |  31 ++++++
 misc/sword/patches/patch-src_modules_common_zstr.cpp           |  31 ++++++
 misc/sword/patches/patch-src_modules_lexdict_rawld4_rawld4.cpp |  13 ++
 misc/sword/patches/patch-src_modules_lexdict_rawld_rawld.cpp   |  13 ++
 misc/sword/patches/patch-src_modules_lexdict_zld_zld.cpp       |  13 ++
 9 files changed, 203 insertions(+), 1 deletions(-)

diffs (246 lines):

diff -r e9f26fbe6758 -r 63fb54a79c4c misc/sword/distinfo
--- a/misc/sword/distinfo       Sat Dec 17 14:22:04 2016 +0000
+++ b/misc/sword/distinfo       Sat Dec 17 14:22:39 2016 +0000
@@ -1,7 +1,15 @@
-$NetBSD: distinfo,v 1.2 2015/11/03 23:49:52 agc Exp $
+$NetBSD: distinfo,v 1.3 2016/12/17 14:22:39 joerg Exp $
 
 SHA1 (sword-1.7.4.tar.gz) = 9fc1070baaa9f991056c1dc0d0455022de2610db
 RMD160 (sword-1.7.4.tar.gz) = 55a0b741a97e58f29cfa5eca4572719660447393
 SHA512 (sword-1.7.4.tar.gz) = 4c8b183e613367364439cc7a8a842012f75180fccc8eb775b9af2dc4c10f39c152261d35f0aadaaa91a11df36ab1a4057c2edc50ea4b0b3bb0ab0a847ff68f75
 Size (sword-1.7.4.tar.gz) = 2157882 bytes
 SHA1 (patch-Makefile.in) = 512be822cb96144244cb93f70ca2ba409a90db9b
+SHA1 (patch-src_keys_treekeyidx.cpp) = 2bae86876bfb4a1c74faf709d016e7665514cd90
+SHA1 (patch-src_mgr_swmgr.cpp) = e0e63ec4df6b07c89678a33827cc925f3ccb2369
+SHA1 (patch-src_modules_common_rawstr.cpp) = 89bf3b3bf389393dc0d826f6aa0ab1a4737d30bd
+SHA1 (patch-src_modules_common_rawstr4.cpp) = 966d0f6b52ac888abb27376ec0cedd2336bc6b99
+SHA1 (patch-src_modules_common_zstr.cpp) = 591cbf710dade59c5249d8c15ae2db5ac791db03
+SHA1 (patch-src_modules_lexdict_rawld4_rawld4.cpp) = d2cebbe1ddd5456d52f651079fc6e4eec46905d4
+SHA1 (patch-src_modules_lexdict_rawld_rawld.cpp) = 48a55530444b6e10412bdb08d2036395554a7299
+SHA1 (patch-src_modules_lexdict_zld_zld.cpp) = a4f4075da1011728ff6fde8c0a13b4c9d45fe3cd
diff -r e9f26fbe6758 -r 63fb54a79c4c misc/sword/patches/patch-src_keys_treekeyidx.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sword/patches/patch-src_keys_treekeyidx.cpp  Sat Dec 17 14:22:39 2016 +0000
@@ -0,0 +1,49 @@
+$NetBSD: patch-src_keys_treekeyidx.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $
+
+--- src/keys/treekeyidx.cpp.orig       2016-12-17 11:16:23.463483505 +0000
++++ src/keys/treekeyidx.cpp
+@@ -61,7 +61,7 @@ TreeKeyIdx::TreeKeyIdx(const char *idxPa
+       buf.setFormatted("%s.dat", path);
+       datfd = FileMgr::getSystemFileMgr()->open(buf, fileMode, true);
+ 
+-      if (datfd <= 0) {
++      if (!datfd) {
+               SWLog::getSystemLog()->logError("%d", errno);
+               error = errno;
+       }
+@@ -331,7 +331,7 @@ void TreeKeyIdx::getTreeNodeFromDatOffse
+       __s32  tmp;
+       __u16  tmp2;
+ 
+-      if (datfd > 0) {
++      if (datfd) {
+ 
+               datfd->seek(ioffset, SEEK_SET);
+ 
+@@ -385,7 +385,7 @@ char TreeKeyIdx::getTreeNodeFromIdxOffse
+       }
+ 
+       node->offset = ioffset;
+-      if (idxfd > 0) {
++      if (idxfd) {
+               if (idxfd->getFd() > 0) {
+                       idxfd->seek(ioffset, SEEK_SET);
+                       if (idxfd->read(&offset, 4) == 4) {
+@@ -422,7 +422,7 @@ void TreeKeyIdx::saveTreeNodeOffsets(Tre
+       long datOffset = 0;
+       __s32 tmp;
+ 
+-      if (idxfd > 0) {
++      if (idxfd) {
+               idxfd->seek(node->offset, SEEK_SET);
+               if (idxfd->read(&tmp, 4) != 4) {
+                       datOffset = datfd->seek(0, SEEK_END);
+@@ -488,7 +488,7 @@ void TreeKeyIdx::copyFrom(const TreeKeyI
+ void TreeKeyIdx::saveTreeNode(TreeNode *node) {
+       long datOffset = 0;
+       __s32 tmp;
+-      if (idxfd > 0) {
++      if (idxfd) {
+ 
+               idxfd->seek(node->offset, SEEK_SET);
+               datOffset = datfd->seek(0, SEEK_END);
diff -r e9f26fbe6758 -r 63fb54a79c4c misc/sword/patches/patch-src_mgr_swmgr.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sword/patches/patch-src_mgr_swmgr.cpp        Sat Dec 17 14:22:39 2016 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_mgr_swmgr.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $
+
+--- src/mgr/swmgr.cpp.orig     2016-12-17 11:17:23.119076977 +0000
++++ src/mgr/swmgr.cpp
+@@ -1362,7 +1362,7 @@ void SWMgr::InstallScan(const char *dirn
+                                       else {
+                                               if (!conffd) {
+                                                       conffd = FileMgr::getSystemFileMgr()->open(config->filename.c_str(), FileMgr::WRONLY|FileMgr::APPEND);
+-                                                      if (conffd > 0)
++                                                      if (conffd)
+                                                               conffd->seek(0L, SEEK_END);
+                                                       else {
+                                                               FileMgr::getSystemFileMgr()->close(conffd);
diff -r e9f26fbe6758 -r 63fb54a79c4c misc/sword/patches/patch-src_modules_common_rawstr.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sword/patches/patch-src_modules_common_rawstr.cpp    Sat Dec 17 14:22:39 2016 +0000
@@ -0,0 +1,31 @@
+$NetBSD: patch-src_modules_common_rawstr.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $
+
+--- src/modules/common/rawstr.cpp.orig 2016-12-17 11:18:57.855699237 +0000
++++ src/modules/common/rawstr.cpp
+@@ -74,7 +74,7 @@ RawStr::RawStr(const char *ipath, int fi
+       buf.setFormatted("%s.dat", path);
+       datfd = FileMgr::getSystemFileMgr()->open(buf, fileMode, true);
+ 
+-      if (datfd < 0) {
++      if (!datfd) {
+               SWLog::getSystemLog()->logError("%d", errno);
+       }
+ 
+@@ -111,7 +111,7 @@ void RawStr::getIDXBufDat(long ioffset, 
+ {
+       int size;
+       char ch;
+-      if (datfd > 0) {
++      if (datfd) {
+               datfd->seek(ioffset, SEEK_SET);
+               for (size = 0; datfd->read(&ch, 1) == 1; size++) {
+                       if ((ch == '\\') || (ch == 10) || (ch == 13))
+@@ -145,7 +145,7 @@ void RawStr::getIDXBuf(long ioffset, cha
+ {
+       __u32 offset;
+       
+-      if (idxfd > 0) {
++      if (idxfd) {
+               idxfd->seek(ioffset, SEEK_SET);
+               idxfd->read(&offset, 4);
+ 
diff -r e9f26fbe6758 -r 63fb54a79c4c misc/sword/patches/patch-src_modules_common_rawstr4.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sword/patches/patch-src_modules_common_rawstr4.cpp   Sat Dec 17 14:22:39 2016 +0000
@@ -0,0 +1,31 @@
+$NetBSD: patch-src_modules_common_rawstr4.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $
+
+--- src/modules/common/rawstr4.cpp.orig        2016-12-17 11:19:27.919536682 +0000
++++ src/modules/common/rawstr4.cpp
+@@ -74,7 +74,7 @@ RawStr4::RawStr4(const char *ipath, int 
+       buf.setFormatted("%s.dat", path);
+       datfd = FileMgr::getSystemFileMgr()->open(buf, fileMode, true);
+ 
+-      if (datfd < 0) {
++      if (!datfd) {
+               SWLog::getSystemLog()->logError("%d", errno);
+       }
+ 
+@@ -111,7 +111,7 @@ void RawStr4::getIDXBufDat(long ioffset,
+ {
+       int size;
+       char ch;
+-      if (datfd > 0) {
++      if (datfd) {
+               datfd->seek(ioffset, SEEK_SET);
+               for (size = 0; datfd->read(&ch, 1) == 1; size++) {
+                       if ((ch == '\\') || (ch == 10) || (ch == 13))
+@@ -145,7 +145,7 @@ void RawStr4::getIDXBuf(long ioffset, ch
+ {
+       __u32 offset;
+       
+-      if (idxfd > 0) {
++      if (idxfd) {
+               idxfd->seek(ioffset, SEEK_SET);
+ 
+               idxfd->read(&offset, 4);
diff -r e9f26fbe6758 -r 63fb54a79c4c misc/sword/patches/patch-src_modules_common_zstr.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sword/patches/patch-src_modules_common_zstr.cpp      Sat Dec 17 14:22:39 2016 +0000
@@ -0,0 +1,31 @@
+$NetBSD: patch-src_modules_common_zstr.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $
+
+--- src/modules/common/zstr.cpp.orig   2016-12-17 11:20:39.892321366 +0000
++++ src/modules/common/zstr.cpp
+@@ -83,7 +83,7 @@ zStr::zStr(const char *ipath, int fileMo
+       buf.setFormatted("%s.zdt", path);
+       zdtfd = FileMgr::getSystemFileMgr()->open(buf, fileMode, true);
+ 
+-      if (datfd <= 0) {
++      if (!datfd) {
+               SWLog::getSystemLog()->logError("%d", errno);
+       }
+ 
+@@ -133,7 +133,7 @@ void zStr::getKeyFromDatOffset(long ioff
+ {
+       int size;
+       char ch;
+-      if (datfd > 0) {
++      if (datfd) {
+               datfd->seek(ioffset, SEEK_SET);
+               for (size = 0; datfd->read(&ch, 1) == 1; size++) {
+                       if ((ch == '\\') || (ch == 10) || (ch == 13))
+@@ -167,7 +167,7 @@ void zStr::getKeyFromIdxOffset(long ioff
+ {
+       __u32 offset;
+       
+-      if (idxfd > 0) {
++      if (idxfd) {
+               idxfd->seek(ioffset, SEEK_SET);
+               idxfd->read(&offset, 4);
+               offset = swordtoarch32(offset);
diff -r e9f26fbe6758 -r 63fb54a79c4c misc/sword/patches/patch-src_modules_lexdict_rawld4_rawld4.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sword/patches/patch-src_modules_lexdict_rawld4_rawld4.cpp    Sat Dec 17 14:22:39 2016 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_modules_lexdict_rawld4_rawld4.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $
+
+--- src/modules/lexdict/rawld4/rawld4.cpp.orig 2016-12-17 11:25:37.737259594 +0000
++++ src/modules/lexdict/rawld4/rawld4.cpp
+@@ -166,7 +166,7 @@ void RawLD4::deleteEntry() {
+ 
+ 
+ long RawLD4::getEntryCount() const {
+-      if (idxfd < 0) return 0;
++      if (!idxfd) return 0;
+       return idxfd->seek(0, SEEK_END) / IDXENTRYSIZE;
+ }
+ 
diff -r e9f26fbe6758 -r 63fb54a79c4c misc/sword/patches/patch-src_modules_lexdict_rawld_rawld.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sword/patches/patch-src_modules_lexdict_rawld_rawld.cpp      Sat Dec 17 14:22:39 2016 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_modules_lexdict_rawld_rawld.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $
+
+--- src/modules/lexdict/rawld/rawld.cpp.orig   2016-12-17 11:25:49.864362105 +0000
++++ src/modules/lexdict/rawld/rawld.cpp
+@@ -168,7 +168,7 @@ void RawLD::deleteEntry() {
+ 
+ 
+ long RawLD::getEntryCount() const {
+-      if (idxfd < 0) return 0;
++      if (!idxfd) return 0;
+       return idxfd->seek(0, SEEK_END) / IDXENTRYSIZE;
+ }
+ 
diff -r e9f26fbe6758 -r 63fb54a79c4c misc/sword/patches/patch-src_modules_lexdict_zld_zld.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sword/patches/patch-src_modules_lexdict_zld_zld.cpp  Sat Dec 17 14:22:39 2016 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_modules_lexdict_zld_zld.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $
+
+--- src/modules/lexdict/zld/zld.cpp.orig       2016-12-17 11:25:18.042867195 +0000
++++ src/modules/lexdict/zld/zld.cpp
+@@ -166,7 +166,7 @@ void zLD::deleteEntry() {
+ 
+ long zLD::getEntryCount() const
+ {
+-      if (idxfd < 0) return 0;
++      if (!idxfd) return 0;
+       return idxfd->seek(0, SEEK_END) / IDXENTRYSIZE;
+ }
+ 



Home | Main Index | Thread Index | Old Index