This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
change 10199 backwards?
authorDoug MacEachern <dougm@covalent.net>
Sat, 26 May 2001 11:26:07 +0000 (04:26 -0700)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 26 May 2001 22:35:31 +0000 (22:35 +0000)
Message-ID: <Pine.LNX.4.21.0105261118510.22038-100000@mako.covalent.net>

p4raw-id: //depot/perl@10224

sv.c

diff --git a/sv.c b/sv.c
index 7b53a43..659398c 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -8082,9 +8082,9 @@ Perl_sv_dup(pTHX_ SV *sstr)
        break;
     case SVt_RV:
        SvANY(dstr)     = new_XRV();
-       SvRV(dstr)      = SvWEAKREF(SvRV(sstr))
-                       ? sv_dup_inc(SvRV(sstr))
-                       : sv_dup(SvRV(sstr));
+       SvRV(dstr)      = SvRV(sstr) && SvWEAKREF(SvRV(sstr))
+                       ? sv_dup(SvRV(sstr))
+                       : sv_dup_inc(SvRV(sstr));
        break;
     case SVt_PV:
        SvANY(dstr)     = new_XPV();
@@ -8092,8 +8092,8 @@ Perl_sv_dup(pTHX_ SV *sstr)
        SvLEN(dstr)     = SvLEN(sstr);
        if (SvROK(sstr))
            SvRV(dstr)  = SvWEAKREF(SvRV(sstr))
-                       ? sv_dup_inc(SvRV(sstr))
-                       : sv_dup(SvRV(sstr));
+                       ? sv_dup(SvRV(sstr))
+                       : sv_dup_inc(SvRV(sstr));
        else if (SvPVX(sstr) && SvLEN(sstr))
            SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
        else
@@ -8106,8 +8106,8 @@ Perl_sv_dup(pTHX_ SV *sstr)
        SvIVX(dstr)     = SvIVX(sstr);
        if (SvROK(sstr))
            SvRV(dstr)  = SvWEAKREF(SvRV(sstr))
-                       ? sv_dup_inc(SvRV(sstr))
-                       : sv_dup(SvRV(sstr));
+                       ? sv_dup(SvRV(sstr))
+                       : sv_dup_inc(SvRV(sstr));
        else if (SvPVX(sstr) && SvLEN(sstr))
            SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
        else
@@ -8121,8 +8121,8 @@ Perl_sv_dup(pTHX_ SV *sstr)
        SvNVX(dstr)     = SvNVX(sstr);
        if (SvROK(sstr))
            SvRV(dstr)  = SvWEAKREF(SvRV(sstr))
-                       ? sv_dup_inc(SvRV(sstr))
-                       : sv_dup(SvRV(sstr));
+                       ? sv_dup(SvRV(sstr))
+                       : sv_dup_inc(SvRV(sstr));
        else if (SvPVX(sstr) && SvLEN(sstr))
            SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
        else
@@ -8138,8 +8138,8 @@ Perl_sv_dup(pTHX_ SV *sstr)
        SvSTASH(dstr)   = hv_dup_inc(SvSTASH(sstr));
        if (SvROK(sstr))
            SvRV(dstr)  = SvWEAKREF(SvRV(sstr))
-                       ? sv_dup_inc(SvRV(sstr))
-                       : sv_dup(SvRV(sstr));
+                       ? sv_dup(SvRV(sstr))
+                       : sv_dup_inc(SvRV(sstr));
        else if (SvPVX(sstr) && SvLEN(sstr))
            SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
        else
@@ -8155,8 +8155,8 @@ Perl_sv_dup(pTHX_ SV *sstr)
        SvSTASH(dstr)   = hv_dup_inc(SvSTASH(sstr));
        if (SvROK(sstr))
            SvRV(dstr)  = SvWEAKREF(SvRV(sstr))
-                       ? sv_dup_inc(SvRV(sstr))
-                       : sv_dup(SvRV(sstr));
+                       ? sv_dup(SvRV(sstr))
+                       : sv_dup_inc(SvRV(sstr));
        else if (SvPVX(sstr) && SvLEN(sstr))
            SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
        else
@@ -8175,8 +8175,8 @@ Perl_sv_dup(pTHX_ SV *sstr)
        SvSTASH(dstr)   = hv_dup_inc(SvSTASH(sstr));
        if (SvROK(sstr))
            SvRV(dstr)  = SvWEAKREF(SvRV(sstr))
-                       ? sv_dup_inc(SvRV(sstr))
-                       : sv_dup(SvRV(sstr));
+                       ? sv_dup(SvRV(sstr))
+                       : sv_dup_inc(SvRV(sstr));
        else if (SvPVX(sstr) && SvLEN(sstr))
            SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
        else
@@ -8208,8 +8208,8 @@ Perl_sv_dup(pTHX_ SV *sstr)
        SvSTASH(dstr)   = hv_dup_inc(SvSTASH(sstr));
        if (SvROK(sstr))
            SvRV(dstr)  = SvWEAKREF(SvRV(sstr))
-                       ? sv_dup_inc(SvRV(sstr))
-                       : sv_dup(SvRV(sstr));
+                       ? sv_dup(SvRV(sstr))
+                       : sv_dup_inc(SvRV(sstr));
        else if (SvPVX(sstr) && SvLEN(sstr))
            SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
        else
@@ -8231,8 +8231,8 @@ Perl_sv_dup(pTHX_ SV *sstr)
        SvSTASH(dstr)   = hv_dup_inc(SvSTASH(sstr));
        if (SvROK(sstr))
            SvRV(dstr)  = SvWEAKREF(SvRV(sstr))
-                       ? sv_dup_inc(SvRV(sstr))
-                       : sv_dup(SvRV(sstr));
+                       ? sv_dup(SvRV(sstr))
+                       : sv_dup_inc(SvRV(sstr));
        else if (SvPVX(sstr) && SvLEN(sstr))
            SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
        else