memcpy has n o in it, as pinted ut by Sarathy.
[p5sagit/p5-mst-13.2.git] / doio.c
diff --git a/doio.c b/doio.c
index d253f98..19f7861 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -504,8 +504,8 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
     IoFLAGS(io) &= ~IOf_NOLINE;
     if (writing) {
        dTHR;
-        bool is_reg = IoTYPE(io) == '>' && S_ISCHR(PL_statbuf.st_mode);
-       if (IoTYPE(io) == 's' || is_reg)
+       if (IoTYPE(io) == 's'
+           || (IoTYPE(io) == '>' && S_ISCHR(PL_statbuf.st_mode)) )
        {
            char *mode;
            if (out_raw)
@@ -520,10 +520,6 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
                IoIFP(io) = Nullfp;
                goto say_false;
            }
-            else {
-                if (is_reg)
-                    IoIFP(io) = IoOFP(io); /* avoid double close() */
-            }
        }
        else
            IoOFP(io) = fp;
@@ -1921,6 +1917,9 @@ Perl_do_msgrcv(pTHX_ SV **mark, SV **sp)
 
     id = SvIVx(*++mark);
     mstr = *++mark;
+    /* suppress warning when reading into undef var --jhi */
+    if (! SvOK(mstr))
+       sv_setpvn(mstr, "", 0);
     msize = SvIVx(*++mark);
     mtype = (long)SvIVx(*++mark);
     flags = SvIVx(*++mark);