summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-16 21:04:04 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-05-16 21:04:04 +0000
commit4e6ea2c3b30d1ef2a7f2c68db5d82351f13b502f (patch)
treee87d56404d662c2bff7ca69affa0f1844fc833db /pp_sys.c
parent2216f30a5dac149d1cc2bcb601b9e69c1ff374bf (diff)
downloadperl-4e6ea2c3b30d1ef2a7f2c68db5d82351f13b502f.tar.gz
[win32] merge change#985 from maintbranch
p4raw-link: @985 on //depot/maint-5.004/perl: cb99a88456c6181881501e9f4881bc3d3d3e919e p4raw-id: //depot/win32/perl@1002
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/pp_sys.c b/pp_sys.c
index f4827bb5d9..d00d162c86 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -290,10 +290,11 @@ PP(pp_warn)
tmps = SvPV(TOPs, na);
}
if (!tmps || !*tmps) {
- (void)SvUPGRADE(ERRSV, SVt_PV);
- if (SvPOK(ERRSV) && SvCUR(ERRSV))
- sv_catpv(ERRSV, "\t...caught");
- tmps = SvPV(ERRSV, na);
+ SV *error = ERRSV;
+ (void)SvUPGRADE(error, SVt_PV);
+ if (SvPOK(error) && SvCUR(error))
+ sv_catpv(error, "\t...caught");
+ tmps = SvPV(error, na);
}
if (!tmps || !*tmps)
tmps = "Warning: something's wrong";
@@ -305,6 +306,8 @@ PP(pp_die)
{
djSP; dMARK;
char *tmps;
+ SV *tmpsv = Nullsv;
+ char *pat = "%s";
if (SP - MARK != 1) {
dTARGET;
do_join(TARG, &sv_no, MARK, SP);
@@ -312,17 +315,26 @@ PP(pp_die)
SP = MARK + 1;
}
else {
- tmps = SvPV(TOPs, na);
+ tmpsv = TOPs;
+ tmps = SvROK(tmpsv) ? Nullch : SvPV(tmpsv, na);
}
if (!tmps || !*tmps) {
- (void)SvUPGRADE(ERRSV, SVt_PV);
- if (SvPOK(ERRSV) && SvCUR(ERRSV))
- sv_catpv(ERRSV, "\t...propagated");
- tmps = SvPV(ERRSV, na);
+ SV *error = ERRSV;
+ (void)SvUPGRADE(error, SVt_PV);
+ if(tmpsv ? SvROK(tmpsv) : SvROK(error)) {
+ if(tmpsv)
+ SvSetSV(error,tmpsv);
+ pat = Nullch;
+ }
+ else {
+ if (SvPOK(error) && SvCUR(error))
+ sv_catpv(error, "\t...propagated");
+ tmps = SvPV(error, na);
+ }
}
if (!tmps || !*tmps)
tmps = "Died";
- DIE("%s", tmps);
+ DIE(pat, tmps);
}
/* I/O. */