From ab70fb1de13ea6b185c20fe7e2fa4fd0c065733f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 24 Feb 2000 00:08:14 +0000 Subject: [PATCH] fix for wxSplitPath(foo/.filename) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6255 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filefn.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 9a0a061a8f..25935ed14f 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1781,9 +1781,10 @@ void WXDLLEXPORT wxSplitPath(const wxChar *pszFileName, #else // assume Unix const wxChar *pLastSeparator = wxStrrchr(pszFileName, wxFILE_SEP_PATH_UNIX); - if ( pDot == pszFileName ) + if ( (pDot == pszFileName) || (*(pDot - 1) == wxFILE_SEP_PATH_UNIX) ) { - // under Unix files like .profile are treated in a special way + // 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 -- 2.45.2