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) {
while( node && !ISEND(ptr, word, len) ) {
if ( node->isskip ) {
+ /*
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) );