diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-08 10:26:15 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-08 10:26:15 +0000 |
commit | 98eae8f585b9800849b5e5482e2d405f21bab67e (patch) | |
tree | ce00cfd416299b06127f22e32f8bc3e7f0b47090 /pp_ctl.c | |
parent | c305c6a05369da2338dc1201b35b0dff2e8d6a5d (diff) | |
download | perl-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.c | 37 |
1 files changed, 18 insertions, 19 deletions
@@ -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 |