Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83583 - trunk/tools/regression/src/report
From: steven_at_[hidden]
Date: 2013-03-26 10:11:41


Author: steven_watanabe
Date: 2013-03-26 10:11:40 EDT (Tue, 26 Mar 2013)
New Revision: 83583
URL: http://svn.boost.org/trac/boost/changeset/83583

Log:
I completely misread the definition of rfind.
Text files modified:
   trunk/tools/regression/src/report/common.cpp | 5 ++---
   1 files changed, 2 insertions(+), 3 deletions(-)

Modified: trunk/tools/regression/src/report/common.cpp
==============================================================================
--- trunk/tools/regression/src/report/common.cpp (original)
+++ trunk/tools/regression/src/report/common.cpp 2013-03-26 10:11:40 EDT (Tue, 26 Mar 2013)
@@ -184,9 +184,8 @@
     }
     // check that the tails of the strings are the same
     std::size_t tail_size = pattern_end - pattern_start;
- if(tail_size == 0) return true; // a trailing star (rfind is buggy in msvc-11)
- std::size_t off = text.rfind(pattern.data() + pattern_start, text_start, tail_size);
- return off != std::string::npos && (off + tail_size == text.size());
+ return tail_size <= text.size() - text_start &&
+ pattern.substr(pattern_start, tail_size) == text.substr(text.size() - tail_size, tail_size);
 }
 
 // date-time


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk