Mercurial > hg > octave-lyh > gnulib-hg
changeset 1329:818db3848f2b
(re_search_2): Fix handling of at_dot.
Fix the way RANGE is set when handling begbuf.
author | Richard Stallman <rms@gnu.org> |
---|---|
date | Sat, 25 Apr 1998 03:37:36 +0000 |
parents | 0aa10b723959 |
children | 76c0fe6b0692 |
files | regex.c |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/regex.c +++ b/regex.c @@ -3710,13 +3710,13 @@ range = total_size - startpos; /* If the search isn't to be a backwards one, don't waste time in a - search for a pattern that must be anchored. */ + search for a pattern anchored at beginning of buffer. */ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0) { if (startpos > 0) return -1; else - range = 1; + range = 0; } #ifdef emacs @@ -3724,8 +3724,8 @@ don't keep searching past point. */ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0) { - range = PT - startpos; - if (range <= 0) + range = PT_BYTE - BEGV_BYTE - startpos; + if (range < 0) return -1; } #endif /* emacs */