aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-04-25 03:37:36 +0000
committerRichard M. Stallman1998-04-25 03:37:36 +0000
commit7b140fd7c705f14f8725254f67e951fd9829a22f (patch)
tree279f13aa53e013daf31ed20b3bba69235a95d126
parent6f46329ac13a1edbb2596181fb8c083169814b0b (diff)
downloademacs-7b140fd7c705f14f8725254f67e951fd9829a22f.tar.gz
emacs-7b140fd7c705f14f8725254f67e951fd9829a22f.zip
(re_search_2): Fix handling of at_dot.
Fix the way RANGE is set when handling begbuf.
-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 */