diff options
author | Craig A. Berry <craigberry@mac.com> | 2010-01-16 16:31:01 -0600 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2010-01-16 17:17:50 -0600 |
commit | 666d8aa22e6926f5d5320cb2c48d6641485e576e (patch) | |
tree | 10bc2704fe0c1ec70e61f9815d2c60345ec216d4 | |
parent | 596f450b74e963069b08e852c2f88cad7d3ef2e6 (diff) | |
download | perl-666d8aa22e6926f5d5320cb2c48d6641485e576e.tar.gz |
Correct VMS-specific handling of $! in Perl_magic_get.
0097b436152452e403cc71b4f1a1cfd30ec0ba1a had introduced a test failure
on VMS because it only set the POK flag in the non-VMS code path,
which was an easy mistake to make because accumulated patches had
over time made the #ifdef jungle way more tangled than it needed to
be. There is really only one line that needs to be VMS-specific.
-rw-r--r-- | mg.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1035,13 +1035,13 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) sv_copypv(sv, PL_ors_sv); break; case '!': + { + dSAVE_ERRNO; #ifdef VMS sv_setnv(sv, (NV)((errno == EVMSERR) ? vaxc$errno : errno)); - sv_setpv(sv, errno ? Strerror(errno) : ""); #else - { - dSAVE_ERRNO; sv_setnv(sv, (NV)errno); +#endif #ifdef OS2 if (errno == errno_isOS2 || errno == errno_isOS2_set) sv_setpv(sv, os2error(Perl_rc)); @@ -1051,7 +1051,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) SvPOK_on(sv); /* may have got removed during taint processing */ RESTORE_ERRNO; } -#endif + SvRTRIM(sv); SvNOK_on(sv); /* what a wonderful hack! */ break; |