aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/regex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/regex.c b/src/regex.c
index a6c186c5c13..76000894044 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -3710,13 +3710,13 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
3710 range = total_size - startpos; 3710 range = total_size - startpos;
3711 3711
3712 /* If the search isn't to be a backwards one, don't waste time in a 3712 /* If the search isn't to be a backwards one, don't waste time in a
3713 search for a pattern that must be anchored. */ 3713 search for a pattern anchored at beginning of buffer. */
3714 if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0) 3714 if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
3715 { 3715 {
3716 if (startpos > 0) 3716 if (startpos > 0)
3717 return -1; 3717 return -1;
3718 else 3718 else
3719 range = 1; 3719 range = 0;
3720 } 3720 }
3721 3721
3722#ifdef emacs 3722#ifdef emacs
@@ -3724,8 +3724,8 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
3724 don't keep searching past point. */ 3724 don't keep searching past point. */
3725 if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0) 3725 if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0)
3726 { 3726 {
3727 range = PT - startpos; 3727 range = PT_BYTE - BEGV_BYTE - startpos;
3728 if (range <= 0) 3728 if (range < 0)
3729 return -1; 3729 return -1;
3730 } 3730 }
3731#endif /* emacs */ 3731#endif /* emacs */