Fixed String::GetWordPosition
Former-commit-id: df701345b94a899f91d4f67d270b2da20c23e904
This commit is contained in:
parent
4ebd391e05
commit
ce6902d37c
|
|
@ -2447,20 +2447,21 @@ unsigned int NzString::GetWordPosition(unsigned int index, nzUInt32 flags) const
|
|||
}
|
||||
else
|
||||
{
|
||||
while (ptr != &m_sharedString->string[m_sharedString->size])
|
||||
do
|
||||
{
|
||||
if (!std::isspace(*ptr++))
|
||||
if (std::isspace(*ptr))
|
||||
inWord = false;
|
||||
else
|
||||
{
|
||||
if (!inWord)
|
||||
{
|
||||
inWord = true;
|
||||
if (++currentWord > index)
|
||||
return ptr-m_sharedString->string;
|
||||
return ptr - m_sharedString->string;
|
||||
}
|
||||
}
|
||||
else
|
||||
inWord = false;
|
||||
}
|
||||
while (*++ptr);
|
||||
}
|
||||
|
||||
return npos;
|
||||
|
|
|
|||
Loading…
Reference in New Issue