]> git.eshelyaron.com Git - emacs.git/commitdiff
(simple_search): In the loop of backward searching,
authorKenichi Handa <handa@m17n.org>
Fri, 17 Nov 2006 12:12:15 +0000 (12:12 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 17 Nov 2006 12:12:15 +0000 (12:12 +0000)
check also the byte position against the limit.

src/ChangeLog
src/search.c

index c799feb1b3a5a4632ee32e585230c224be35e916..2f7149e6e94a6321f54caa525a62c067b1288161 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-17  NIIMI Satoshi  <sa2c@sa2c.net>  (tiny change)
+
+       * search.c (simple_search): In the loop of backward searching,
+       check also the byte position against the limit.
+
 2006-11-14  Romain Francoise  <romain@orebokech.com>
 
        * minibuf.c (Fcompleting_read): Fix typo in docstring.
index 7c3151b76b8475df0bd7c161be0542c9e767f35a..d6572c5397a830795ae52d5b994d65ce171f6db2 100644 (file)
@@ -1514,7 +1514,7 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
            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)