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
// path and not for the last path element itself.
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)
: wxLstat(path, &st);