This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix for [perl #61976] Errno ($!) not evaluated to a error message string
[perl5.git] / mg.c
diff --git a/mg.c b/mg.c
index fb91325..ddfc2ff 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1048,6 +1048,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
        else
 #endif
        sv_setpv(sv, errno ? Strerror(errno) : "");
+       SvPOK_on(sv);   /* may have got removed during taint processing */
        RESTORE_ERRNO;
        }
 #endif