summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1998-05-25 20:14:54 +0000
committerRichard Stallman <rms@gnu.org>1998-05-25 20:14:54 +0000
commitf6fc39af8d13a8c99ba533c9fb06f860d9ed4690 (patch)
treea4e19ba71906a60a69e4ed51e25cfa5003a6608e /regex.c
parentf88ac7eba56503b7c3f965f681eb9d6dc4082f97 (diff)
downloadgnulib-f6fc39af8d13a8c99ba533c9fb06f860d9ed4690.tar.gz
(re_search_2): Don't use ++ inside RE_TRANSLATE.
(re_match_2_internal): Likewise.
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/regex.c b/regex.c
index ed4cfc9d95..a638e1734d 100644
--- a/regex.c
+++ b/regex.c
@@ -3807,12 +3807,18 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
else
while (range > lim
&& !fastmap[(unsigned char)
- RE_TRANSLATE (translate, (unsigned char) *d++)])
- range--;
+ RE_TRANSLATE (translate, (unsigned char) *d)])
+ {
+ d++;
+ range--;
+ }
}
else
- while (range > lim && !fastmap[(unsigned char) *d++])
- range--;
+ while (range > lim && !fastmap[(unsigned char) *d])
+ {
+ d++;
+ range--;
+ }
startpos += irange - range;
}
@@ -4526,9 +4532,10 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
do
{
PREFETCH ();
- if ((unsigned char) RE_TRANSLATE (translate, (unsigned char) *d++)
+ if ((unsigned char) RE_TRANSLATE (translate, (unsigned char) *d)
!= (unsigned char) *p++)
goto fail;
+ d++;
}
while (--mcnt);
}