diff options
| author | Richard M. Stallman | 1998-05-25 20:14:54 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-05-25 20:14:54 +0000 |
| commit | 33c46939565fcaa1212177953baf2823046b96bd (patch) | |
| tree | 1cfcf266e6eb08ba1e9acef9badd14380753cb5d /src | |
| parent | bbcac09c81753d00741a0fe29dfa8f58e409a45b (diff) | |
| download | emacs-33c46939565fcaa1212177953baf2823046b96bd.tar.gz emacs-33c46939565fcaa1212177953baf2823046b96bd.zip | |
(re_search_2): Don't use ++ inside RE_TRANSLATE.
(re_match_2_internal): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/regex.c b/src/regex.c index ed4cfc9d95a..a638e1734dd 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -3807,12 +3807,18 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) | |||
| 3807 | else | 3807 | else |
| 3808 | while (range > lim | 3808 | while (range > lim |
| 3809 | && !fastmap[(unsigned char) | 3809 | && !fastmap[(unsigned char) |
| 3810 | RE_TRANSLATE (translate, (unsigned char) *d++)]) | 3810 | RE_TRANSLATE (translate, (unsigned char) *d)]) |
| 3811 | range--; | 3811 | { |
| 3812 | d++; | ||
| 3813 | range--; | ||
| 3814 | } | ||
| 3812 | } | 3815 | } |
| 3813 | else | 3816 | else |
| 3814 | while (range > lim && !fastmap[(unsigned char) *d++]) | 3817 | while (range > lim && !fastmap[(unsigned char) *d]) |
| 3815 | range--; | 3818 | { |
| 3819 | d++; | ||
| 3820 | range--; | ||
| 3821 | } | ||
| 3816 | 3822 | ||
| 3817 | startpos += irange - range; | 3823 | startpos += irange - range; |
| 3818 | } | 3824 | } |
| @@ -4526,9 +4532,10 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) | |||
| 4526 | do | 4532 | do |
| 4527 | { | 4533 | { |
| 4528 | PREFETCH (); | 4534 | PREFETCH (); |
| 4529 | if ((unsigned char) RE_TRANSLATE (translate, (unsigned char) *d++) | 4535 | if ((unsigned char) RE_TRANSLATE (translate, (unsigned char) *d) |
| 4530 | != (unsigned char) *p++) | 4536 | != (unsigned char) *p++) |
| 4531 | goto fail; | 4537 | goto fail; |
| 4538 | d++; | ||
| 4532 | } | 4539 | } |
| 4533 | while (--mcnt); | 4540 | while (--mcnt); |
| 4534 | } | 4541 | } |