Adding the new test would be swell.
[p5sagit/p5-mst-13.2.git] / doop.c
diff --git a/doop.c b/doop.c
index 2b504a1..a5c1ce3 100644 (file)
--- a/doop.c
+++ b/doop.c
@@ -667,14 +667,16 @@ Perl_do_join(pTHX_ register SV *sv, SV *del, register SV **mark, register SV **s
        ++mark;
     }
 
+    sv_setpv(sv, "");
+    if (PL_tainting && SvMAGICAL(sv))
+       SvTAINTED_off(sv);
+
     if (items-- > 0) {
-       sv_setpv(sv, "");
        if (*mark)
            sv_catsv(sv, *mark);
        mark++;
     }
-    else
-       sv_setpv(sv,"");
+
     if (delimlen) {
        for (; items > 0; items--,mark++) {
            sv_catsv(sv,del);