git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30347
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
bool wxFileName::IsPathSeparator(wxChar ch, wxPathFormat format)
{
// wxString::Find() doesn't work as expected with NUL - it will always find
bool wxFileName::IsPathSeparator(wxChar ch, wxPathFormat format)
{
// wxString::Find() doesn't work as expected with NUL - it will always find
- // it, so it is almost surely a bug if this function is called with NUL arg
- wxASSERT_MSG( ch != _T('\0'), _T("shouldn't be called with NUL") );
-
- return GetPathSeparators(format).Find(ch) != wxNOT_FOUND;
+ // it, so test for it separately
+ return ch != _T('\0') && GetPathSeparators(format).Find(ch) != wxNOT_FOUND;
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------