From 6931775adceffb9ed6e3bbac49c20d0a4e43c72a Mon Sep 17 00:00:00 2001 From: Jerry Ling Date: Wed, 2 Sep 2020 10:33:42 -0400 Subject: [PATCH] Update base/strings/search.jl Co-authored-by: Milan Bouchet-Valat --- base/strings/search.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/strings/search.jl b/base/strings/search.jl index e3e45cc9889afa..dca4d808e10baf 100644 --- a/base/strings/search.jl +++ b/base/strings/search.jl @@ -266,7 +266,7 @@ function _search(s::Union{AbstractString,AbstractVector{<:Union{Int8,UInt8}}}, idx = _searchindex(s,t,i) if isempty(t) idx:idx-1 - elseif idx > firstindex(s) - 1 + elseif idx >= firstindex(s) idx:(idx + lastindex(t) - 1) else nothing