From: Pablo Neira Ayuso Date: Fri, 3 Feb 2006 01:15:41 +0000 (-0800) Subject: [TEXTSEARCH]: Fix broken good shift array calculation in Boyer-Moore X-Git-Tag: v2.6.16-rc3~210^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f330317ab4973178423aba750d6d0ca5ce0024a;p=pandora-kernel.git [TEXTSEARCH]: Fix broken good shift array calculation in Boyer-Moore The current logic does not calculate correctly the good shift array: Let x be the pattern that is being searched. Let y be the block of data. The good shift array aligns the segment: x[i+1 ... m-1] = y[i+j+1 ... j+m-1] with its rightmost occurrence in x that fulfils x[i] neq y[i+j]. In previous version, the good shift array for the pattern ANPANMAN is: [1, 8, 3, 8, 8, 8, 8, 8] and should be: [1, 8, 3, 6, 6, 6, 6, 6] Signed-off-by: Pablo Neira Ayuso Signed-off-by: David S. Miller --- Reading git-diff-tree failed