summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2004-03-21 03:27:04 -0600
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-03-21 17:22:42 +0000
commit3b8c0df9bfb9b3699a23e8633f5ede3b929d4620 (patch)
tree1f0f8b28552fb6a80108cbe8780fdef53a65e611 /pp.c
parenta7ec4e2e48d9a1e5e168070e2793619b1758b3bb (diff)
downloadperl-3b8c0df9bfb9b3699a23e8633f5ede3b929d4620.tar.gz
Finally, this "Negative repeat count" warning wasn't such a great
idea. Disable it. But add tests for this : Subject: Re: [perl #27811] (@x) x -1 is a panic Message-ID: <20040321152704.GA9041@petdance.com> p4raw-id: //depot/perl@22549
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/pp.c b/pp.c
index 53c7162915..4c3e377ec4 100644
--- a/pp.c
+++ b/pp.c
@@ -1386,11 +1386,8 @@ PP(pp_repeat)
dSP; dATARGET; tryAMAGICbin(repeat,opASSIGN);
{
register IV count = POPi;
- if (count < 0) {
- if (ckWARN(WARN_MISC))
- Perl_warner(aTHX_ packWARN(WARN_MISC), "Negative repeat count");
+ if (count < 0)
count = 0;
- }
if (GIMME == G_ARRAY && PL_op->op_private & OPpREPEAT_DOLIST) {
dMARK;
I32 items = SP - MARK;