projects
/
tedtools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e72b58a
)
Fix check of end word with its length
author
teodor
<teodor>
Wed, 9 Jul 2008 14:59:34 +0000
(14:59 +0000)
committer
teodor
<teodor>
Wed, 9 Jul 2008 14:59:34 +0000
(14:59 +0000)
sfxstr.c
patch
|
blob
|
history
diff --git
a/sfxstr.c
b/sfxstr.c
index
0dd5fa7
..
6337f8c
100644
(file)
--- a/
sfxstr.c
+++ b/
sfxstr.c
@@
-139,7
+139,7
@@
SFSInit_c(SFSTree *info, char **in) {
return info;
}
return info;
}
-#define ISEND(p,w,l) ( (l>0) ? ( ((char*)(p))-(w)
<
(l) ) : ( *(p) == '\0' ) )
+#define ISEND(p,w,l) ( (l>0) ? ( ((char*)(p))-(w)
>=
(l) ) : ( *(p) == '\0' ) )
void*
SFSFindData(SFSTree *info, char *word, int len) {
void*
SFSFindData(SFSTree *info, char *word, int len) {
@@
-149,9
+149,10
@@
SFSFindData(SFSTree *info, char *word, int len) {
while( node && !ISEND(ptr, word, len) ) {
if ( node->isskip ) {
while( node && !ISEND(ptr, word, len) ) {
if ( node->isskip ) {
+ /*
if ( len>0 && len - (((char*)ptr) - word) > node->nchar )
return NULL;
if ( len>0 && len - (((char*)ptr) - word) > node->nchar )
return NULL;
- else if ( STRNCMP(ptr, ((char*)node)+node->dataptr, node->nchar) ) {
+ else
*/
if ( STRNCMP(ptr, ((char*)node)+node->dataptr, node->nchar) ) {
ptr+=node->nchar;
if ( ISEND(ptr, word, len) && node->isword) {
return (void*) ( ((char*)(node->data)) + ((node->haschild) ? sizeof(SFSNode*) : 0) );
ptr+=node->nchar;
if ( ISEND(ptr, word, len) && node->isword) {
return (void*) ( ((char*)(node->data)) + ((node->haschild) ? sizeof(SFSNode*) : 0) );