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 |
1.1 --- a/ucx/string.c Thu Feb 23 15:25:26 2017 +0100 1.2 +++ b/ucx/string.c Mon Feb 27 11:45:31 2017 +0100 1.3 @@ -217,7 +217,7 @@ 1.4 ptable_w(useheap, ptable, i, j); 1.5 while (i < match.length) { 1.6 while (j >= 1 && match.ptr[j-1] != match.ptr[i]) { 1.7 - ptable_r(j, useheap, ptable, j-i); 1.8 + ptable_r(j, useheap, ptable, j-1); 1.9 } 1.10 i++; j++; 1.11 ptable_w(useheap, ptable, i, j);