changeset 74033:94626132135d

(simple_search): In the loop of backward searching, check also the byte position against the limit.
author Kenichi Handa <handa@m17n.org>
date Fri, 17 Nov 2006 12:12:05 +0000
parents ee10cd92b99c
children 855dde2986ea
files src/search.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c	Fri Nov 17 07:57:11 2006 +0000
+++ b/src/search.c	Fri Nov 17 12:12:05 2006 +0000
@@ -1514,7 +1514,7 @@
 	    int this_len_byte = len_byte;
 	    unsigned char *p = pat;
 
-	    if (pos - len < lim)
+	    if (this_pos < lim || this_pos_byte < lim_byte)
 	      goto stop;
 
 	    while (this_len > 0)