From b0230a69bcf6db9a18bbdefb0c3027c6a438ed55 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 3 Mar 2000 14:05:42 +0000 Subject: [PATCH] fatal bug in wxSplitPath fixed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6409 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filefn.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 25935ed14f..9cea28b83a 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1781,15 +1781,18 @@ void WXDLLEXPORT wxSplitPath(const wxChar *pszFileName, #else // assume Unix const wxChar *pLastSeparator = wxStrrchr(pszFileName, wxFILE_SEP_PATH_UNIX); - if ( (pDot == pszFileName) || (*(pDot - 1) == wxFILE_SEP_PATH_UNIX) ) + if ( pDot ) { - // under Unix, dot may be (and commonly is) the first character of the - // filename, don't treat the entire filename as extension in this case - pDot = NULL; + if ( (pDot == pszFileName) || (*(pDot - 1) == wxFILE_SEP_PATH_UNIX) ) + { + // under Unix, dot may be (and commonly is) the first character of the + // filename, don't treat the entire filename as extension in this case + pDot = NULL; + } } #endif // MSW/Unix - if ( pDot < pLastSeparator ) + if ( pDot && (pDot < pLastSeparator) ) { // the dot is part of the path, not the start of the extension pDot = NULL; -- 2.45.2