Hello everyone.
I'm new to this mailing-list but I have a very annoying and urgent problem
concerning Boost and the STL.
I just upgraded to Boost 1.33.1 which is needed for the new version of
libtorrent, linked statically in one of my DLLs.
Build of Boost went quite well (using BJam)
Build of lib went OK.
Build of DLL : no problem either.
But then at runtime I get this :
Unhandled exception at 0x77e79282 in TestFileDl.exe: Microsoft C++
exception: boost::filesystem::filesystem_error @ 0x0012d654.
Exception thrown in [path_posix_windows.cpp] line 339 :
if ( !checker( name ) )
{
boost::throw_exception( filesystem_error(
"boost::filesystem::path",
"invalid name \"" + name + "\" in path: \"" + src +
"\"" ) );
}
... because this check does not behave properly :
BOOST_FILESYSTEM_DECL bool windows_name( const std::string & name )
{
return name.size() != 0
&& name.find_first_of( windows_invalid_chars ) == std::string::npos
<-------------- (here)
&& *(name.end()-1) != ' '
&& (*(name.end()-1) != '.'
|| name.length() == 1 || name == "..");
}
... because find_first_of does not return what it should, in [xstring] :
size_type find_first_of(const _Elem *_Ptr,
size_type _Off, size_type _Count) const
{ // look for one of [_Ptr, _Ptr + _Count) at or after _Off
if (0 < _Count && _Off < _Mysize)
{ // room for match, look for it
const _Elem *const _Vptr = _Myptr() + _Mysize;
for (const _Elem *_Uptr = _Myptr() + _Off; _Uptr < _Vptr;
++_Uptr)
if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
return (_Uptr - _Myptr()); // found a match
}
return (npos); // no match
}
Obviously the std::string is screwed up here, because I think _Mysize should
not be 31, which makes the [for] searche outside the boudaries of the
buffer, thus returning the wrong results...
+ this 0x0012d854 {"main_session.log"} const
std::basic_string