fixup potential invalid index error

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27702 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2009-01-27 09:51:21 +00:00
parent dcdcfb1a8c
commit 622fe7971f

View file

@ -4072,8 +4072,8 @@ static NSFileManager *fm = nil;
}
r.length = l - r.location;
}
// Remove trailing ('.') component.
if (l > root && (*caiImp)(s, caiSel, l-1) == '.'
// Remove trailing ('.') as long as it's preceeded by a path separator.
if (l > root && l > 1 && (*caiImp)(s, caiSel, l-1) == '.'
&& pathSepMember((*caiImp)(s, caiSel, l-2)) == YES)
{
l--;