# HG changeset patch # User Kenichi Handa # Date 1164847293 0 # Node ID 4df8b1be70dcd1b94cb885455aa8bd36982e25d9 # Parent 798b321ef3603ab99a228c5060c94994223760ab (simple_search): Fix previous change. diff -r 798b321ef360 -r 4df8b1be70dc src/search.c --- 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)