]> git.saurik.com Git - wxWidgets.git/commitdiff
made IsPathSeparator(NUL) work (by returning false)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 7 Nov 2004 20:06:37 +0000 (20:06 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 7 Nov 2004 20:06:37 +0000 (20:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30347 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/filename.cpp

index 94799d1a964f9aba107c9dc2ea67042523b700bf..d0776be7859cab2bc7e786eda800e17d1ed4e617 100644 (file)
@@ -1277,10 +1277,8 @@ wxString wxFileName::GetPathTerminators(wxPathFormat format)
 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;
 }
 
 // ----------------------------------------------------------------------------