Skip to content

Commit

Permalink
Make "foobar".substr(2..*) work
Browse files Browse the repository at this point in the history
Spotted by ChoHag++
  • Loading branch information
lizmat committed Aug 5, 2015
1 parent e9c5679 commit 0dcbba7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/Str.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,9 @@ sub SUBSTR-SANITY(Str \what, $start, $want, \from, \chars) {
if from < 0 || from > $max;

chars = nqp::istype($start, Range)
?? $start.max - $start.excludes-max - from + 1
?? $start == Inf
?? $max - from
!! $start.max - $start.excludes-max - from + 1
!! $want.defined
?? $want === Inf
?? $max - from
Expand Down

0 comments on commit 0dcbba7

Please sign in to comment.