From: Rafael Garcia-Suarez Date: Tue, 8 Aug 2006 09:22:27 +0000 (+0000) Subject: Simplification in Perl_magic_clearsig, plus a fix similar and X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b274dc4e33bd87e9e4f43fc4b13cc5f7336de591;p=p5sagit%2Fp5-mst-13.2.git Simplification in Perl_magic_clearsig, plus a fix similar and symmetrical to the one implemented in change #28669. p4raw-link: @28669 on //depot/perl: 9289f461126f104eef437e7c6d2f1f640f935646 p4raw-id: //depot/perl@28675 --- diff --git a/mg.c b/mg.c index d4412f8..2e3bf46 100644 --- a/mg.c +++ b/mg.c @@ -1224,14 +1224,12 @@ Perl_magic_clearsig(pTHX_ SV *sv, MAGIC *mg) SV** svp = NULL; if (strEQ(s,"__DIE__")) svp = &PL_diehook; - else if (strEQ(s,"__WARN__")) + else if (strEQ(s,"__WARN__") && PL_warnhook != PERL_WARNHOOK_FATAL) svp = &PL_warnhook; - else - Perl_croak(aTHX_ "No such hook: %s", s); if (svp && *svp) { - SV * const to_dec = *svp; + SV *const to_dec = *svp; *svp = NULL; - SvREFCNT_dec(to_dec); + SvREFCNT_dec(to_dec); } } else {