fixes major bug in construction of KMP prefix table for strstr()

Mon, 27 Feb 2017 11:45:31 +0100

author
Mike Becker <universe@uap-core.de>
date
Mon, 27 Feb 2017 11:45:31 +0100
changeset 238
27b31c2c959c
parent 237
5ba9de6361ff
child 239
1634c3ea89da

fixes major bug in construction of KMP prefix table for strstr()

ucx/string.c file | annotate | diff | comparison | revisions
--- a/ucx/string.c	Thu Feb 23 15:25:26 2017 +0100
+++ b/ucx/string.c	Mon Feb 27 11:45:31 2017 +0100
@@ -217,7 +217,7 @@
     ptable_w(useheap, ptable, i, j);
     while (i < match.length) {
         while (j >= 1 && match.ptr[j-1] != match.ptr[i]) {
-            ptable_r(j, useheap, ptable, j-i);
+            ptable_r(j, useheap, ptable, j-1);
         }
         i++; j++;
         ptable_w(useheap, ptable, i, j);

mercurial