Mon, 27 Feb 2017 11:45:31 +0100
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);