Skip to content

Commit

Permalink
Merge pull request JuliaLang#26549 from bkamins/patch-18
Browse files Browse the repository at this point in the history
Fix nextind out of bounds error
  • Loading branch information
vchuravy committed Mar 28, 2018
2 parents 40127a6 + 60d4a8f commit 8ec16ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/strings/string.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ function _nextind_str(s, i::Int)
return i′ < i ? nextind(s, i′) : i+1
end
# first continuation byte
@inbounds b = codeunit(s, i += 1)
(i += 1) > n && return i
@inbounds b = codeunit(s, i)
b & 0xc0 0x80 && return i
((i += 1) > n) | (l < 0xe0) && return i
# second continuation byte
Expand Down

0 comments on commit 8ec16ea

Please sign in to comment.