From: Philip Newton Date: Tue, 15 May 2001 16:31:05 +0000 (+0200) Subject: Re: [ID 20010515.001] -DPERL_Y2KWARN doesn't do what it should (Not OK: perl v5.7... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fd15e78369fdf756c6e71889b4ecf6804ef91244;p=p5sagit%2Fp5-mst-13.2.git Re: [ID 20010515.001] -DPERL_Y2KWARN doesn't do what it should (Not OK: perl v5.7.1 +DEVEL10104 on i586-linux 2.2.16-22 (UNINST Message-ID: <3B0159C9.1905.1C6AEF9@localhost> Fix PERL_Y2KWARN test to check before rather than after appending. p4raw-id: //depot/perl@10128 --- diff --git a/pp_hot.c b/pp_hot.c index bc7a1b9..023a05b 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -156,6 +156,19 @@ PP(pp_concat) if (TARG != left) sv_setsv(TARG, left); +#if defined(PERL_Y2KWARN) + if ((SvIOK(right) || SvNOK(right)) && ckWARN(WARN_Y2K) && SvOK(TARG)) { + STRLEN n; + char *s = SvPV(TARG,n); + if (n >= 2 && s[n-2] == '1' && s[n-1] == '9' + && (n == 2 || !isDIGIT(s[n-3]))) + { + Perl_warner(aTHX_ WARN_Y2K, "Possible Y2K bug: %s", + "about to append an integer to '19'"); + } + } +#endif + if (TARG == right) { if (left == right) { /* $right = $right . $right; */ @@ -175,19 +188,6 @@ PP(pp_concat) sv_catsv(TARG, right); } -#if defined(PERL_Y2KWARN) - if ((SvIOK(right) || SvNOK(right)) && ckWARN(WARN_Y2K)) { - STRLEN n; - char *s = SvPV(TARG,n); - if (n >= 2 && s[n-2] == '1' && s[n-1] == '9' - && (n == 2 || !isDIGIT(s[n-3]))) - { - Perl_warner(aTHX_ WARN_Y2K, "Possible Y2K bug: %s", - "about to append an integer to '19'"); - } - } -#endif - SETTARG; RETURN; }