This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl.h: Remove some obsolete macros
[perl5.git] / doop.c
diff --git a/doop.c b/doop.c
index f5a40ef..7cc227f 100644 (file)
--- a/doop.c
+++ b/doop.c
@@ -1018,7 +1018,7 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
     STRLEN rightlen;
     const char *lc;
     const char *rc;
-    STRLEN len;
+    STRLEN len = 0;
     STRLEN lensave;
     const char *lsave;
     const char *rsave;
@@ -1095,17 +1095,22 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
      * portion.  That means that at least one of the operands has to be
      * entirely non-UTF-8, and the length of that operand has to be before the
      * first above-FF in the other */
-    if (left_utf8) {
-        if (right_utf8 || rightlen > leftlen) {
-            Perl_croak(aTHX_ fatal_above_ff_msg, PL_op_desc[optype]);
+    if (left_utf8 || right_utf8) {
+        if (left_utf8) {
+            if (right_utf8 || rightlen > leftlen) {
+                Perl_croak(aTHX_ fatal_above_ff_msg, PL_op_desc[optype]);
+            }
+            len = rightlen;
         }
-        len = rightlen;
-    }
-    else if (right_utf8) {
-        if (leftlen > rightlen) {
-            Perl_croak(aTHX_ fatal_above_ff_msg, PL_op_desc[optype]);
+        else if (right_utf8) {
+            if (leftlen > rightlen) {
+                Perl_croak(aTHX_ fatal_above_ff_msg, PL_op_desc[optype]);
+            }
+            len = leftlen;
         }
-        len = leftlen;
+
+        Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
+                               deprecated_above_ff_msg, PL_op_desc[optype]);
     }
     else {  /* Neither is UTF-8 */
         len = MIN(leftlen, rightlen);