summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-10-08 10:26:15 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-10-08 10:26:15 +0000
commit98eae8f585b9800849b5e5482e2d405f21bab67e (patch)
treece00cfd416299b06127f22e32f8bc3e7f0b47090 /pp_ctl.c
parentc305c6a05369da2338dc1201b35b0dff2e8d6a5d (diff)
downloadperl-98eae8f585b9800849b5e5482e2d405f21bab67e.tar.gz
remove kludgey duplicate background error avoidance (caused
"leaks"; %@ wasn't even user-visible under -Dusethreads); only repeats of most recent error are now avoided p4raw-id: //depot/perl@4316
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index c2409ba5f4..a2b313937d 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1272,26 +1272,25 @@ Perl_die_where(pTHX_ char *message, STRLEN msglen)
if (message) {
if (PL_in_eval & EVAL_KEEPERR) {
- SV **svp;
-
- svp = hv_fetch(ERRHV, message, msglen, TRUE);
- if (svp) {
- if (!SvIOK(*svp)) {
- static char prefix[] = "\t(in cleanup) ";
- SV *err = ERRSV;
- sv_upgrade(*svp, SVt_IV);
- (void)SvIOK_only(*svp);
- if (!SvPOK(err))
- sv_setpv(err,"");
- SvGROW(err, SvCUR(err)+sizeof(prefix)+msglen);
- sv_catpvn(err, prefix, sizeof(prefix)-1);
- sv_catpvn(err, message, msglen);
- if (ckWARN(WARN_UNSAFE)) {
- STRLEN start = SvCUR(err)-msglen-sizeof(prefix)+1;
- Perl_warner(aTHX_ WARN_UNSAFE, SvPVX(err)+start);
- }
+ static char prefix[] = "\t(in cleanup) ";
+ SV *err = ERRSV;
+ char *e = Nullch;
+ if (!SvPOK(err))
+ sv_setpv(err,"");
+ else if (SvCUR(err) >= sizeof(prefix)+msglen-1) {
+ e = SvPV(err, n_a);
+ e += n_a - msglen;
+ if (*e != *message || strNE(e,message))
+ e = Nullch;
+ }
+ if (!e) {
+ SvGROW(err, SvCUR(err)+sizeof(prefix)+msglen);
+ sv_catpvn(err, prefix, sizeof(prefix)-1);
+ sv_catpvn(err, message, msglen);
+ if (ckWARN(WARN_UNSAFE)) {
+ STRLEN start = SvCUR(err)-msglen-sizeof(prefix)+1;
+ Perl_warner(aTHX_ WARN_UNSAFE, SvPVX(err)+start);
}
- sv_inc(*svp);
}
}
else