Tidied last fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27674 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-01-25 07:01:46 +00:00
parent 98fbc66b1c
commit 456b2a7d49

View file

@ -4072,30 +4072,24 @@ static NSFileManager *fm = nil;
}
r.length = l - r.location;
}
// Remove trailing ('.') component.
if (l > root && (*caiImp)(s, caiSel, l-1) == '.'
&& pathSepMember((*caiImp)(s, caiSel, l-2)) == YES)
{
l--;
[s deleteCharactersInRange: NSMakeRange(l, 1)];
}
// Condense ('/./') sequences.
r = (NSRange){root, l-root};
while ((r = [s rangeOfString: @"." options: 0 range: r]).length == 1)
{
if (r.location > 0
&& pathSepMember((*caiImp)(s, caiSel, r.location-1)) == YES)
&& pathSepMember((*caiImp)(s, caiSel, r.location-1)) == YES
&& pathSepMember((*caiImp)(s, caiSel, r.location+1)) == YES)
{
unsigned pos = NSMaxRange(r);
if (pos == l)
{
[s deleteCharactersInRange: r];
l -= r.length;
}
else if (pathSepMember((*caiImp)(s, caiSel, pos)) == YES)
{
r.length++;
[s deleteCharactersInRange: r];
l -= r.length;
}
else
{
r.location++;
}
r.length++;
[s deleteCharactersInRange: r];
l -= r.length;
}
else
{