Fix bug in wxFileName::Exists("/").
Don't remove too many trailing slashes, the lone slash of "/" should remain. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -351,7 +351,16 @@ bool DoStatAny(wxStructStat& st, wxString path, const wxFileName* fn)
|
|||||||
// path and not for the last path element itself.
|
// path and not for the last path element itself.
|
||||||
|
|
||||||
while ( wxEndsWithPathSeparator(path) )
|
while ( wxEndsWithPathSeparator(path) )
|
||||||
path.RemoveLast();
|
{
|
||||||
|
const size_t posLast = path.length() - 1;
|
||||||
|
if ( !posLast )
|
||||||
|
{
|
||||||
|
// Don't turn "/" into empty string.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
path.erase(posLast);
|
||||||
|
}
|
||||||
|
|
||||||
int ret = !fn || fn->ShouldFollowLink() ? wxStat(path, &st)
|
int ret = !fn || fn->ShouldFollowLink() ? wxStat(path, &st)
|
||||||
: wxLstat(path, &st);
|
: wxLstat(path, &st);
|
||||||
|
Reference in New Issue
Block a user