This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix [perl #37533] open pragma ignored for all 3-arg opens
[perl5.git] / perlio.c
index e9ea0c3..23df5e8 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -1461,7 +1461,7 @@ PerlIO_resolve_layers(pTHX_ const char *layers,
             */
        }
     }
-    if (!layers)
+    if (!layers || !*layers)
        layers = PerlIO_context_layers(aTHX_ mode);
     if (layers && *layers) {
        PerlIO_list_t *av;
@@ -1497,7 +1497,7 @@ PerlIO_openn(pTHX_ const char *layers, const char *mode, int fd,
 {
     if (!f && narg == 1 && *args == &PL_sv_undef) {
        if ((f = PerlIO_tmpfile())) {
-           if (!layers)
+           if (!layers || !*layers)
                layers = PerlIO_context_layers(aTHX_ mode);
            if (layers && *layers)
                PerlIO_apply_layers(aTHX_ f, mode, layers);