changeset 90703:4df8b1be70dc

(simple_search): Fix previous change.
author Kenichi Handa <handa@m17n.org>
date Thu, 30 Nov 2006 00:41:33 +0000
parents 798b321ef360
children e9da34566c96
files src/search.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c	Wed Nov 29 13:10:47 2006 +0000
+++ b/src/search.c	Thu Nov 30 00:41:33 2006 +0000
@@ -1481,13 +1481,14 @@
 	  {
 	    /* Try matching at position POS.  */
 	    int this_pos = pos - len;
-	    int this_pos_byte = CHAR_TO_BYTE (this_pos);
+	    int this_pos_byte;
 	    int this_len = len;
 	    int this_len_byte = len_byte;
 	    unsigned char *p = pat;
 
-	    if (this_pos < lim || this_pos_byte < lim_byte)
+	    if (this_pos < lim || (pos_byte - len_byte) < lim_byte)
 	      goto stop;
+	    this_pos_byte = CHAR_TO_BYTE (this_pos);
 	    match_byte = pos_byte - this_pos_byte;
 
 	    while (this_len > 0)