From 9cab749016ef4689ecc1b4e21c9097558433e3a1 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 27 Jan 2010 10:38:38 -0500 Subject: [PATCH] Enhancement - caseless find - Fixed bug that didn't properly consider the starting offset in find. --- src/text.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/text.cpp b/src/text.cpp index 7a3c21b81..fe85d6abc 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -536,12 +536,12 @@ std::string::size_type find ( return 0; // Handle bad begin. - if (begin >= len) + if (begin >= text.length ()) return std::string::npos; // Evaluate these once, for performance reasons. - const char* t = text.c_str (); - const char* start = t + begin; + const char* start = text.c_str (); + const char* t = start + begin; const char* end = start + text.size (); for (; t < end - len; ++t)