diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-10-16 21:21:52 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-11-26 21:03:40 -0700 |
commit | 99461a735b1477d9f175ff3696b07e9c18fb5e34 (patch) | |
tree | fbae7e9d6f41c843da72569a69c87bd4e81b7863 /mg.c | |
parent | d9fe7d23bdbf0c9aeef4f48ea4e0c277e6c504d8 (diff) | |
download | perl-99461a735b1477d9f175ff3696b07e9c18fb5e34.tar.gz |
$^E should have same handling as $! for Win32 and OS/2
Commit 1500bd919ffeae0f3252f8d1bb28b03b043d328e changed the handling of
$! to look for UTF-8 messages. This issue is also present in Win32 for
$^E. The two should have uniform treatment, so this commit causes the
actual same code to be executed for both. OS/2 is also subject to
locale issues, and so it also is changed here to use the same code, so
that future changes will apply to it automatically.
VMS doesn't use locales, so it retains its current behavior.
Note that 1500bd919 has created some field problems, so that the changes
it introduced will be further changed or reverted. The current commit
just makes sure that whatever those further changes are will be
automatically propagated to all necessary platforms.
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -848,12 +848,18 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) sv_setnv(sv, (NV)Perl_rc); sv_setpv(sv, os2error(Perl_rc)); } + if (SvOK(sv) && strNE(SvPVX(sv), "")) { + fixup_errno_string(sv); + } # elif defined(WIN32) { const DWORD dwErr = GetLastError(); sv_setnv(sv, (NV)dwErr); if (dwErr) { PerlProc_GetOSError(sv, dwErr); + if (SvOK(sv)) { + fixup_errno_string(sv); + } } else sv_setpvs(sv, ""); |