]> git.vpit.fr Git - perl/modules/re-engine-Hooks.git/blobdiff - src/5018002/regexec.c
Add support for perl 5.18.2, 5.20.0, and 5.21.[0123]
[perl/modules/re-engine-Hooks.git] / src / 5018002 / regexec.c
similarity index 99%
rename from src/5019000/regexec.c
rename to src/5018002/regexec.c
index f2ea7bb6e346b3b00079943be96e285e520017ad..7c307bdf2d0b30858561efa0bda3e7e0e985a81a 100644 (file)
@@ -6664,7 +6664,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
  scan = *startposp;
  if (max == REG_INFTY)
   max = I32_MAX;
- else if (! utf8_target && scan + max < loceol)
+ else if (! utf8_target && loceol - scan > max)
   loceol = scan + max;
 
  /* Here, for the case of a non-UTF-8 target we have adjusted <loceol> down
@@ -6713,7 +6713,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
    scan = loceol;
   break;
  case CANY:  /* Move <scan> forward <max> bytes, unless goes off end */
-  if (utf8_target && scan + max < loceol) {
+  if (utf8_target && loceol - scan > max) {
 
    /* <loceol> hadn't been adjusted in the UTF-8 case */
    scan +=  max;
@@ -6732,7 +6732,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
   * can use UTF8_IS_INVARIANT() even if the pattern isn't UTF-8, as it's
   * true iff it doesn't matter if the argument is in UTF-8 or not */
   if (UTF8_IS_INVARIANT(c) || (! utf8_target && ! is_utf8_pat)) {
-   if (utf8_target && scan + max < loceol) {
+   if (utf8_target && loceol - scan > max) {
     /* We didn't adjust <loceol> because is UTF-8, but ok to do so,
     * since here, to match at all, 1 char == 1 byte */
     loceol = scan + max;
@@ -6912,7 +6912,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
   /* FALLTHROUGH */
 
  case POSIXA:
-  if (utf8_target && scan + max < loceol) {
+  if (utf8_target && loceol - scan > max) {
 
    /* We didn't adjust <loceol> at the beginning of this routine
    * because is UTF-8, but it is actually ok to do so, since here, to