diff options
author | Mark-Jason Dominus <mjd@plover.com> | 2002-10-30 17:27:53 +0000 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2002-10-30 19:47:12 +0000 |
commit | 545956b788eca1693eabb4527163db9c8186832c (patch) | |
tree | 015329d6c1033a47de15981e0ee9b3522d0b819c /pp_ctl.c | |
parent | 904d85c5b9ccc833788234557fda3bc74a77ca8b (diff) | |
download | perl-545956b788eca1693eabb4527163db9c8186832c.tar.gz |
[perl #18165] "0" fails as right-hand argument to ..
From: Mark-Jason Dominus (via RT) <perlbug@perl.org>
Message-Id: <rt-18165-40816.6.86096008382222@bugs6.perl.org>
(Fixed by making an exception for .."0" in pp_flop.)
p4raw-id: //depot/perl@18073
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -943,10 +943,15 @@ PP(pp_flop) if (SvGMAGICAL(right)) mg_get(right); + /* This code tries to decide if "$left .. $right" should use the + magical string increment, or if the range is numeric (we make + an exception for .."0" [#18165]). AMS 20021031. */ + if (SvNIOKp(left) || !SvPOKp(left) || SvNIOKp(right) || !SvPOKp(right) || (looks_like_number(left) && *SvPVX(left) != '0' && - looks_like_number(right) && *SvPVX(right) != '0')) + looks_like_number(right) && (*SvPVX(right) != '0' || + SvCUR(right) == 1))) { if (SvNV(left) < IV_MIN || SvNV(right) > IV_MAX) DIE(aTHX_ "Range iterator outside integer range"); |