aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/search.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/search.c b/src/search.c
index ce4d1828585..9aa49af665f 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1481,13 +1481,14 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
1481 { 1481 {
1482 /* Try matching at position POS. */ 1482 /* Try matching at position POS. */
1483 int this_pos = pos - len; 1483 int this_pos = pos - len;
1484 int this_pos_byte = CHAR_TO_BYTE (this_pos); 1484 int this_pos_byte;
1485 int this_len = len; 1485 int this_len = len;
1486 int this_len_byte = len_byte; 1486 int this_len_byte = len_byte;
1487 unsigned char *p = pat; 1487 unsigned char *p = pat;
1488 1488
1489 if (this_pos < lim || this_pos_byte < lim_byte) 1489 if (this_pos < lim || (pos_byte - len_byte) < lim_byte)
1490 goto stop; 1490 goto stop;
1491 this_pos_byte = CHAR_TO_BYTE (this_pos);
1491 match_byte = pos_byte - this_pos_byte; 1492 match_byte = pos_byte - this_pos_byte;
1492 1493
1493 while (this_len > 0) 1494 while (this_len > 0)