fatal bug in wxSplitPath fixed

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6409 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-03-03 14:05:42 +00:00
parent 91ff98b7b5
commit b0230a69bc

View File

@@ -1781,15 +1781,18 @@ void WXDLLEXPORT wxSplitPath(const wxChar *pszFileName,
#else // assume Unix #else // assume Unix
const wxChar *pLastSeparator = wxStrrchr(pszFileName, wxFILE_SEP_PATH_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 if ( (pDot == pszFileName) || (*(pDot - 1) == wxFILE_SEP_PATH_UNIX) )
// filename, don't treat the entire filename as extension in this case {
pDot = NULL; // 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 #endif // MSW/Unix
if ( pDot < pLastSeparator ) if ( pDot && (pDot < pLastSeparator) )
{ {
// the dot is part of the path, not the start of the extension // the dot is part of the path, not the start of the extension
pDot = NULL; pDot = NULL;