summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhijit Menon-Sen <ams@wiw.org>2002-10-30 22:30:32 +0000
committerAbhijit Menon-Sen <ams@wiw.org>2002-10-30 22:30:32 +0000
commitee34a4d037b68daf752af80daf8d69eb1e4ef06a (patch)
tree4f933ff466d86cdc71a5168a5647b86c59a302bf
parent545956b788eca1693eabb4527163db9c8186832c (diff)
downloadperl-ee34a4d037b68daf752af80daf8d69eb1e4ef06a.tar.gz
Re: [perl #18114] [no subject] BUG: "-4\n".."0\n" is not DWIM
but "-4\n".."-0\n" is! From: Slaven Rezic <slaven.rezic@berlin.de> 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" <yves.orton@mciworldcom.de> Date: Wed, 30 Oct 2002 11:59:31 -0000 Message-Id: <71B318898201D311845C0008C75DAD1C07B78BF7@defra1ex2> (Applied over previous fix.) p4raw-id: //depot/perl@18074
-rw-r--r--pp_ctl.c3
-rwxr-xr-xt/op/range.t6
2 files changed, 5 insertions, 4 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index a482489f79..a91eb3810a 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 862e64d103..5200db2a23 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";