From 2fb5a4ce6348933b32ea709eae93a9f55809a092 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 7 Nov 2004 20:06:37 +0000 Subject: [PATCH] made IsPathSeparator(NUL) work (by returning false) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30347 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filename.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 94799d1a96..d0776be785 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -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; } // ---------------------------------------------------------------------------- -- 2.45.2