Hi,

There is a bug in StringHelper::startsWith: "std::string::compare(size_type 
pos, size_type len, const std::string& s)" compares a substring of the string 
with s and not vice versa.

Here is a patch.

After that it works at least with easy cases on my x86-64.

Thank you Curt. I vote for a 0.9.8 soon.


Tommi
Index: src/stringhelper.cpp
===================================================================
RCS file: /home/cvspublic/logging-log4cxx/src/stringhelper.cpp,v
retrieving revision 1.11
diff -d -r1.11 stringhelper.cpp
102c102
<       return suffix.compare(s.length() - suffix.length(), suffix.length(), s) == 0;
---
>       return s.compare(s.length() - suffix.length(), suffix.length(), suffix) == 0;
111c111
<       return suffix.compare(s.length() - suffix.length(), suffix.length(), s) == 0;
---
>       return s.compare(s.length() - suffix.length(), suffix.length(), suffix) == 0;

Reply via email to