# HG changeset patch # User Mike Becker # Date 1488192331 -3600 # Node ID 27b31c2c959c1dec54a7aac25583a8c21824869f # Parent 5ba9de6361ff79c4ee6bfe0a9fddd9dcd0569d71 fixes major bug in construction of KMP prefix table for strstr() diff -r 5ba9de6361ff -r 27b31c2c959c ucx/string.c --- 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);