diff options
author | Philip Newton <pne@cpan.org> | 2001-05-15 18:31:05 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-05-16 14:15:36 +0000 |
commit | fd15e78369fdf756c6e71889b4ecf6804ef91244 (patch) | |
tree | 88cef57af63ec4f0add77a813ae13a684a10af79 /pp_hot.c | |
parent | 1d385ed62021799167d9cea7947cebe150c640b8 (diff) | |
download | perl-fd15e78369fdf756c6e71889b4ecf6804ef91244.tar.gz |
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
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -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; } |