[sword-svn] r2171 - trunk/src/modules/common
scribe at www.crosswire.org
scribe at www.crosswire.org
Sun May 18 19:38:51 MST 2008
Author: scribe
Date: 2008-05-18 19:38:50 -0700 (Sun, 18 May 2008)
New Revision: 2171
Modified:
trunk/src/modules/common/rawstr.cpp
trunk/src/modules/common/rawstr4.cpp
trunk/src/modules/common/zstr.cpp
Log:
Modified: trunk/src/modules/common/rawstr.cpp
===================================================================
--- trunk/src/modules/common/rawstr.cpp 2008-05-18 03:38:05 UTC (rev 2170)
+++ trunk/src/modules/common/rawstr.cpp 2008-05-19 02:38:50 UTC (rev 2171)
@@ -201,8 +201,8 @@
// didn't find exact match
if (headoff >= tailoff) {
tryoff = headoff;
- if (!substr) {
- away--; // if our entry doesn't startwith out key, prefer the previous entry over the next
+ if (!substr && ((tryoff != maxoff)||((keylen>1)&&!strncmp(key, trybuf, keylen-1)))) {
+ away--; // if our entry doesn't startwith our key, prefer the previous entry over the next
}
}
if (trybuf)
Modified: trunk/src/modules/common/rawstr4.cpp
===================================================================
--- trunk/src/modules/common/rawstr4.cpp 2008-05-18 03:38:05 UTC (rev 2170)
+++ trunk/src/modules/common/rawstr4.cpp 2008-05-19 02:38:50 UTC (rev 2171)
@@ -209,8 +209,8 @@
// didn't find exact match
if (headoff >= tailoff) {
tryoff = headoff;
- if (!substr) {
- away--; // if our entry doesn't startwith out key, prefer the previous entry over the next
+ if (!substr && ((tryoff != maxoff)||((keylen>1)&&!strncmp(key, trybuf, keylen-1)))) {
+ away--; // if our entry doesn't startwith our key, prefer the previous entry over the next
}
}
if (trybuf)
Modified: trunk/src/modules/common/zstr.cpp
===================================================================
--- trunk/src/modules/common/zstr.cpp 2008-05-18 03:38:05 UTC (rev 2170)
+++ trunk/src/modules/common/zstr.cpp 2008-05-19 02:38:50 UTC (rev 2171)
@@ -217,8 +217,8 @@
// didn't find exact match
if (headoff >= tailoff) {
tryoff = headoff;
- if (!substr) {
- away--; // if our entry doesn't startwith out key, prefer the previous entry over the next
+ if (!substr && ((tryoff != maxoff)||((keylen>1)&&!strncmp(key, trybuf, keylen-1)))) {
+ away--; // if our entry doesn't startwith our key, prefer the previous entry over the next
}
}
if (trybuf)
More information about the sword-cvs
mailing list