/[grep]/grep/src/kwset.c
ViewVC logotype

Diff of /grep/src/kwset.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by charles_levert, Mon Jul 4 05:04:48 2005 UTC revision 1.10 by charles_levert, Mon Jul 4 05:12:17 2005 UTC
# Line 393  kwsprep (kwset_t kws) Line 393  kwsprep (kwset_t kws)
393       of the hairy commentz-walter algorithm. */       of the hairy commentz-walter algorithm. */
394    if (kwset->words == 1 && kwset->trans == NULL)    if (kwset->words == 1 && kwset->trans == NULL)
395      {      {
396          char c;
397    
398        /* Looking for just one string.  Extract it from the trie. */        /* Looking for just one string.  Extract it from the trie. */
399        kwset->target = obstack_alloc(&kwset->obstack, kwset->mind);        kwset->target = obstack_alloc(&kwset->obstack, kwset->mind);
400        for (i = kwset->mind - 1, curr = kwset->trie; i >= 0; --i)        for (i = kwset->mind - 1, curr = kwset->trie; i >= 0; --i)
# Line 406  kwsprep (kwset_t kws) Line 408  kwsprep (kwset_t kws)
408        kwset->mind2 = kwset->mind;        kwset->mind2 = kwset->mind;
409        /* Find the minimal delta2 shift that we might make after        /* Find the minimal delta2 shift that we might make after
410           a backwards match has failed. */           a backwards match has failed. */
411        for (i = 0; i < kwset->mind - 1; ++i)        c = kwset->target[kwset->mind - 1];
412          if (kwset->target[i] == kwset->target[kwset->mind - 1])        for (i = kwset->mind - 2; i >= 0; --i)
413            kwset->mind2 = kwset->mind - (i + 1);          if (kwset->target[i] == c)
414              break;
415          kwset->mind2 = kwset->mind - (i + 1);
416      }      }
417    else    else
418      {      {

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26