develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34031 - trunk/languages/perl6/src/builtins

From:
jonathan
Date:
December 17, 2008 09:00
Subject:
[svn:parrot] r34031 - trunk/languages/perl6/src/builtins
Message ID:
20081217170000.BEE2DCBA12@x12.develooper.com
Author: jonathan
Date: Wed Dec 17 08:59:59 2008
New Revision: 34031

Modified:
   trunk/languages/perl6/src/builtins/any-str.pir

Log:
[rakudo] Make substr handle being given a negative start and length. Patch courtesy of Ronald Schmidt <ronaldxs@software-path.com>.

Modified: trunk/languages/perl6/src/builtins/any-str.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/any-str.pir	(original)
+++ trunk/languages/perl6/src/builtins/any-str.pir	Wed Dec 17 08:59:59 2008
@@ -517,8 +517,10 @@
     len = self.'chars'()
   have_len:
     if len >= 0 goto len_done
+    if start < 0 goto neg_start
     $I0 = self.'chars'()
     len += $I0
+  neg_start:
     len -= start
   len_done:
     $S0 = self



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About