don't treat filenames starting with dot as having empty name and extension equal to the full name without dot (was done like this only for Unix and VMS before, now do it for all platforms)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-06-22 21:56:44 +00:00
parent 91a7f3b04d
commit e5a573a28b

View File

@@ -1676,18 +1676,17 @@ void wxFileName::SplitPath(const wxString& fullpathWithVolume,
size_t posLastDot = fullpath.find_last_of(wxFILE_SEP_EXT); size_t posLastDot = fullpath.find_last_of(wxFILE_SEP_EXT);
size_t posLastSlash = fullpath.find_last_of(sepPath); size_t posLastSlash = fullpath.find_last_of(sepPath);
// check whether this dot occurs at the very beginning of a path component
if ( (posLastDot != wxString::npos) && if ( (posLastDot != wxString::npos) &&
((format == wxPATH_UNIX) || (format == wxPATH_VMS)) ) (posLastDot == 0 ||
{ IsPathSeparator(fullpath[posLastDot - 1]) ||
if ( (posLastDot == 0) || (format == wxPATH_VMS && fullpath[posLastDot - 1] == _T(']'))) )
(fullpath[posLastDot - 1] == sepPath[0u] ) )
{ {
// under Unix and VMS, dot may be (and commonly is) the first // dot may be (and commonly -- at least under Unix -- is) the first
// character of the filename, don't treat the entire filename as // character of the filename, don't treat the entire filename as
// extension in this case // extension in this case
posLastDot = wxString::npos; posLastDot = wxString::npos;
} }
}
// if we do have a dot and a slash, check that the dot is in the name part // if we do have a dot and a slash, check that the dot is in the name part
if ( (posLastDot != wxString::npos) && if ( (posLastDot != wxString::npos) &&