Change 14031 by jhi@alpha on 2002/01/03 01:52:04

        Off-by-one is my middle name.

Affected files ...

.... //depot/perl/regexec.c#238 edit

Differences ...

==== //depot/perl/regexec.c#238 (text) ====
Index: perl/regexec.c
--- perl/regexec.c.~1~  Wed Jan  2 19:00:05 2002
+++ perl/regexec.c      Wed Jan  2 19:00:05 2002
@@ -960,7 +960,7 @@
            c1 = *(U8*)m;
            c2 = PL_fold_locale[c1];
          do_exactf:
-           e = do_utf8 ? s + ln - 1 : strend - ln;
+           e = do_utf8 ? s + ln : strend - ln;
 
            if (norun && e < s)
                e = s;                  /* Due to minlen logic of intuit() */
@@ -980,16 +980,14 @@
                U8 tmpbuf [UTF8_MAXLEN+1];
                U8 foldbuf[UTF8_MAXLEN_FOLD+1];
                STRLEN len, foldlen;
-               char* se;
                
                if (c1 == c2) {
                    while (s <= e) {
                        c = utf8_to_uvchr((U8*)s, &len);
                        if ( c == c1
                             && (ln == len ||
-                                ((se = e + 1) &&
-                                 !ibcmp_utf8(s, &se, 0,  do_utf8,
-                                             m, 0  , ln, UTF)))
+                                ibcmp_utf8(s, 0 , 0,  do_utf8,
+                                           m, 0 , ln, UTF))
                             && (norun || regtry(prog, s)) )
                            goto got_it;
                        else {
@@ -1025,9 +1023,8 @@
 
                        if ( (c == c1 || c == c2)
                             && (ln == len ||
-                                ((se = e + 1) &&
-                                 !ibcmp_utf8(s, &se, 0,  do_utf8,
-                                             m, 0,   ln, UTF)))
+                                ibcmp_utf8(s, 0, 0,  do_utf8,
+                                           m, 0, ln, UTF))
                             && (norun || regtry(prog, s)) )
                            goto got_it;
                        else {
End of Patch.

Reply via email to