Skip to content

Commit

Permalink
Str.split used to ignore limits while splitting on the empty string. …
Browse files Browse the repository at this point in the history
…Corrected that
  • Loading branch information
moritz committed Mar 22, 2009
1 parent eefb89f commit 28a2792
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/setting/Any-str.pm
Expand Up @@ -46,7 +46,10 @@ class Any is also {
my $s = ~self;
if $delimiter eq '' {
return gather {
take $s.substr($_, 1) for 0 .. $s.chars - 1;
take $s.substr($_, 1) for 0 .. ($s.chars - 1 min $l - 2);
if $l <= $s.chars {
take $s.substr($l - 1 );
};
}
}
return gather {
Expand Down

0 comments on commit 28a2792

Please sign in to comment.