Enhancement - caseless compare

- Fixed bug in text.cpp:find that failed to locate a substring if it occurred
  at the end of the string.
This commit is contained in:
Paul Beckingham 2010-01-27 16:28:57 -05:00
parent 0c5a71b02f
commit 4f1183a358
3 changed files with 62 additions and 43 deletions

View file

@ -497,7 +497,7 @@ std::string::size_type find (
const char* start = t;
const char* end = start + text.size ();
for (; t < end - len; ++t)
for (; t <= end - len; ++t)
{
int diff;
for (size_t i = 0; i < len; ++i)
@ -544,7 +544,7 @@ std::string::size_type find (
const char* t = start + begin;
const char* end = start + text.size ();
for (; t < end - len; ++t)
for (; t <= end - len; ++t)
{
int diff;
for (size_t i = 0; i < len; ++i)