From: Abhijit Menon-Sen Date: Wed, 30 Oct 2002 22:30:32 +0000 (+0000) Subject: Re: [perl #18114] [no subject] BUG: "-4\n".."0\n" is not DWIM X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ee34a4d037b68daf752af80daf8d69eb1e4ef06a;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #18114] [no subject] BUG: "-4\n".."0\n" is not DWIM but "-4\n".."-0\n" is! From: Slaven Rezic Date: 30 Oct 2002 16:22:36 +0100 Message-Id: <87n0ow0x4z.fsf@vran.herceg.de> Subject: RE: [perl #18114] [no subject] [TEST PATCH]BUG: "-4\n".."0\n" is not DWIM but "-4\n".."-0\n" is! From: "Orton, Yves" Date: Wed, 30 Oct 2002 11:59:31 -0000 Message-Id: <71B318898201D311845C0008C75DAD1C07B78BF7@defra1ex2> (Applied over previous fix.) p4raw-id: //depot/perl@18074 --- diff --git a/pp_ctl.c b/pp_ctl.c index a482489..a91eb38 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -950,8 +950,7 @@ PP(pp_flop) if (SvNIOKp(left) || !SvPOKp(left) || SvNIOKp(right) || !SvPOKp(right) || (looks_like_number(left) && *SvPVX(left) != '0' && - looks_like_number(right) && (*SvPVX(right) != '0' || - SvCUR(right) == 1))) + looks_like_number(right))) { if (SvNV(left) < IV_MIN || SvNV(right) > IV_MAX) DIE(aTHX_ "Range iterator outside integer range"); diff --git a/t/op/range.t b/t/op/range.t index 862e64d..5200db2 100755 --- a/t/op/range.t +++ b/t/op/range.t @@ -75,5 +75,7 @@ for my $x ("0"..-1) { print "ok 15\n"; # [#18165] Should allow "-4".."0", broken by #4730. (AMS 20021031) -print "not " unless 5 == (() = "-4".."0"); -print "ok 16\n"; +print join(":","-4".."0") eq "-4:-3:-2:-1:0" ? "ok 16\n" : "not ok 16\n"; +print join(":","-4".."-0") eq "-4:-3:-2:-1:0" ? "ok 17\n" : "not ok 17\n"; +print join(":","-4\n".."0\n") eq "-4:-3:-2:-1:0" ? "ok 18\n" : "not ok 18\n"; +print join(":","-4\n".."-0\n") eq "-4:-3:-2:-1:0" ? "ok 19\n" : "not ok 19\n";