Skip to content

Commit

Permalink
Try to handle the .substr cases where $start is outside the length of…
Browse files Browse the repository at this point in the history
… the string.
  • Loading branch information
colomon committed Feb 26, 2010
1 parent 852213b commit 8df8ad7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/Any-str.pm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ augment class Any {
$len -= $start;
}

if ($start > self.chars || $start < -self.chars) {
return Mu;
}

pir::substr(self, $start, $len);
}

Expand Down

0 comments on commit 8df8ad7

Please sign in to comment.