Put back the #8840, it was innocent.
[p5sagit/p5-mst-13.2.git] / sv.c
diff --git a/sv.c b/sv.c
index 1098680..e9dda52 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -4724,17 +4724,15 @@ Perl_sv_eq(pTHX_ register SV *sv1, register SV *sv2)
 
        if (SvUTF8(sv1)) {
            char *pv = (char*)bytes_from_utf8((U8*)pv1, &cur1, &is_utf8);
-           if (is_utf8)
-               return 0;
-           pv1tmp = (pv != pv1);
-           pv1 = pv;
+
+           if ((pv1tmp = (pv != pv1)))
+               pv1 = pv;
        }
        else {
            char *pv = (char *)bytes_from_utf8((U8*)pv2, &cur2, &is_utf8);
-           if (is_utf8)
-               return 0;
-           pv2tmp = (pv != pv2);
-           pv2 = pv;
+
+           if ((pv2tmp = (pv != pv2)))
+               pv2 = pv;
        }
     }
 
@@ -5622,8 +5620,12 @@ Perl_newSVpvn_share(pTHX_ const char *src, I32 len, U32 hash)
         len = -len;
         is_utf8 = TRUE;
     }
-    if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT))
-       src = (char*)bytes_from_utf8((U8*)src, (STRLEN*)&len, &is_utf8);
+    if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) {
+       STRLEN tmplen = len;
+       /* See the note in hv.c:hv_fetch() --jhi */
+       src = (char*)bytes_from_utf8((U8*)src, &tmplen, &is_utf8);
+       len = tmplen;
+    }
     if (!hash)
        PERL_HASH(hash, src, len);
     new_SV(sv);
@@ -6351,6 +6353,25 @@ Perl_sv_setref_iv(pTHX_ SV *rv, const char *classname, IV iv)
 }
 
 /*
+=for apidoc sv_setref_uv
+
+Copies an unsigned integer into a new SV, optionally blessing the SV.  The C<rv>
+argument will be upgraded to an RV.  That RV will be modified to point to
+the new SV.  The C<classname> argument indicates the package for the
+blessing.  Set C<classname> to C<Nullch> to avoid the blessing.  The new SV
+will be returned and will have a reference count of 1.
+
+=cut
+*/
+
+SV*
+Perl_sv_setref_uv(pTHX_ SV *rv, const char *classname, UV uv)
+{
+    sv_setuv(newSVrv(rv,classname), uv);
+    return rv;
+}
+
+/*
 =for apidoc sv_setref_nv
 
 Copies a double into a new SV, optionally blessing the SV.  The C<rv>