summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorGisle Aas <gisle@aas.no>2005-05-18 01:35:47 -0700
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-05-18 16:08:30 +0000
commite5218da503dbb4980410e0018f4cc5dcba3ea666 (patch)
tree896f8cf586a22fa6f98384571dea2ba73b133df3 /mg.c
parent6b09c1601036c61459334bdedef5d7e29e07fcaf (diff)
downloadperl-e5218da503dbb4980410e0018f4cc5dcba3ea666.tar.gz
Well defined $? and introduction of ${^CHILD_ERROR_NATIVE} [PATCH]
Message-ID: <lr8y2cim24.fsf_-_@caliper.activestate.com> p4raw-id: //depot/perl@24501
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mg.c b/mg.c
index 359b8ca994..baad04f718 100644
--- a/mg.c
+++ b/mg.c
@@ -581,8 +581,13 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
case '\001': /* ^A */
sv_setsv(sv, PL_bodytarget);
break;
- case '\003': /* ^C */
- sv_setiv(sv, (IV)PL_minus_c);
+ case '\003': /* ^C, ^CHILD_ERROR_NATIVE */
+ if (*(mg->mg_ptr+1) == '\0') {
+ sv_setiv(sv, (IV)PL_minus_c);
+ }
+ else if (strEQ(mg->mg_ptr, "\003HILD_ERROR_NATIVE")) {
+ sv_setiv(sv, (IV)STATUS_NATIVE);
+ }
break;
case '\004': /* ^D */
@@ -2291,7 +2296,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
STATUS_NATIVE_SET((U32)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv)));
else
#endif
- STATUS_POSIX_SET(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
+ STATUS_UNIX_SET(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
break;
case '!':
{