# New Ticket Created by  "Chris Davaz" 
# Please include the string:  [perl #59642]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=59642 >


Here is a small patch to make split return the empty list on
non-positive limit arguments instead of returning the string split
entirely. Moritz, I think it was you who suggested that negative
arguments be 'rejected by the signature' but I am not sure how to do
this in PIR.
Index: src/builtins/any-str.pir
===================================================================
--- src/builtins/any-str.pir	(revision 31687)
+++ src/builtins/any-str.pir	(working copy)
@@ -411,8 +411,7 @@
 
     # per Perl 5's negative LIMIT behavior
     unless has_count goto positive_count
-    unless count < 1 goto positive_count
-    has_count = 0
+    if count < 1 goto done
 
   positive_count:
     match = regex($S0)

Reply via email to