svn commit: r225437 - user/gabor/grep/trunk/regex

Gabor Kovesdan gabor at FreeBSD.org
Wed Sep 7 14:04:51 UTC 2011


Author: gabor
Date: Wed Sep  7 14:04:51 2011
New Revision: 225437
URL: http://svn.freebsd.org/changeset/base/225437

Log:
  - Correct BC shift

Modified:
  user/gabor/grep/trunk/regex/tre-fastmatch.c

Modified: user/gabor/grep/trunk/regex/tre-fastmatch.c
==============================================================================
--- user/gabor/grep/trunk/regex/tre-fastmatch.c	Wed Sep  7 13:26:20 2011	(r225436)
+++ user/gabor/grep/trunk/regex/tre-fastmatch.c	Wed Sep  7 14:04:51 2011	(r225437)
@@ -142,7 +142,7 @@ static int	fastcmp(const void *, const b
 		mismatch -= u;						\
 	      v = fg->wlen - 1 - mismatch;				\
 	      r = hashtable_get(fg->qsBc_table,				\
-		&((tre_char_t *)startptr)[mismatch + 1], &bc);		\
+		&str_wide[j + fg->wlen], &bc);				\
 	      gs = fg->bmGs[mismatch];					\
 	    }								\
 	    bc = (r == HASH_OK) ? bc : fg->defBc;			\
@@ -158,7 +158,7 @@ static int	fastcmp(const void *, const b
 	      v = fg->len - 1 - mismatch;				\
 	      gs = fg->sbmGs[mismatch];					\
 	    }								\
-	  bc = fg->qsBc[((unsigned char *)startptr)[mismatch + 1]];	\
+	  bc = fg->qsBc[((unsigned char *)str_byte)[j + fg->len]];	\
 	  DPRINT(("tre_fast_match: mismatch on character %c, "		\
 		 "BC %d, GS %d\n",					\
 		 ((unsigned char *)startptr)[mismatch + 1], bc, gs));	\


More information about the svn-src-user mailing list