add skipping of threads and threads::shared on default builds
[p5sagit/p5-mst-13.2.git] / doio.c
diff --git a/doio.c b/doio.c
index fdcef27..0be42df 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -281,6 +281,13 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
            else {
                fp = PerlProc_popen(name,mode);
            }
+           if (num_svs) {
+               if (*type) {
+                   if (PerlIO_apply_layers(aTHX_ fp, mode, type) != 0) {
+                       goto say_false;
+                   }
+               }
+           }
        }
        else if (*type == IoTYPE_WRONLY) {
            TAINT_PROPER("open");
@@ -316,7 +323,7 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
                    if (num_svs > 1) {
                        Perl_croak(aTHX_ "More than one argument to '%c&' open",IoTYPE(io));
                    }
-                   if (num_svs && SvIOK(*svp)) {
+                   if (num_svs && (SvIOK(*svp) || (SvPOK(*svp) && looks_like_number(*svp)))) {
                        fd = SvUV(*svp);
                    }
                    else if (isDIGIT(*type)) {
@@ -483,6 +490,14 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
                fp = PerlProc_popen(name,mode);
            }
            IoTYPE(io) = IoTYPE_PIPE;
+           if (num_svs) {
+               for (; isSPACE(*type); type++) ;
+               if (*type) {
+                   if (PerlIO_apply_layers(aTHX_ fp, mode, type) != 0) {
+                       goto say_false;
+                   }
+               }
+           }
        }
        else {
            if (num_svs)
@@ -790,7 +805,7 @@ Perl_nextargv(pTHX_ register GV *gv)
 #endif
                }
                else {
-#if !defined(DOSISH) && !defined(AMIGAOS) && !defined(__CYGWIN__)
+#if !defined(DOSISH) && !defined(AMIGAOS)
 #  ifndef VMS  /* Don't delete; use automatic file versioning */
                    if (UNLINK(PL_oldname) < 0) {
                        if (ckWARN_d(WARN_INPLACE))     
@@ -904,6 +919,7 @@ Perl_do_pipe(pTHX_ SV *sv, GV *rgv, GV *wgv)
        goto badexit;
     IoIFP(rstio) = PerlIO_fdopen(fd[0], "r");
     IoOFP(wstio) = PerlIO_fdopen(fd[1], "w");
+    IoOFP(rstio) = IoIFP(rstio);
     IoIFP(wstio) = IoOFP(wstio);
     IoTYPE(rstio) = IoTYPE_RDONLY;
     IoTYPE(wstio) = IoTYPE_WRONLY;