String::FindLast/FindWord: Fix bug where index wouldn't be used (#177)

* String::FindLast/FindWord: Fix bug where index wouldn't be used

* Log change
This commit is contained in:
S6066
2018-08-01 23:12:02 +02:00
committed by Jérôme Leclercq
parent 271f7202ed
commit 4a09de7e0b
2 changed files with 4 additions and 3 deletions

View File

@@ -976,7 +976,7 @@ namespace Nz
if (pos >= m_sharedString->size)
return npos;
char* ptr = &m_sharedString->string[m_sharedString->size-1];
char* ptr = &m_sharedString->string[pos];
if (flags & CaseInsensitive)
{
@@ -1751,7 +1751,7 @@ namespace Nz
return npos;
///Algo 3.FindWord#3 (Size of the pattern unknown)
const char* ptr = m_sharedString->string.get();
const char* ptr = &m_sharedString->string[pos];
if (flags & HandleUtf8)
{
if (utf8::internal::is_trail(*ptr))
@@ -1931,7 +1931,7 @@ namespace Nz
if (pos >= m_sharedString->size)
return npos;
char* ptr = m_sharedString->string.get();
char* ptr = &m_sharedString->string[pos];
if (flags & HandleUtf8)
{
///Algo 3.FindWord#3 (Iterator too slow for #2)