summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 07069cad4b..a482489f79 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -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");