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:
rfm 2009-01-25 07:01:46 +00:00
parent af7f09463c
commit baf969486b

View file

@ -4072,21 +4072,20 @@ static NSFileManager *fm = nil;
} }
r.length = l - r.location; 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. // Condense ('/./') sequences.
r = (NSRange){root, l-root}; r = (NSRange){root, l-root};
while ((r = [s rangeOfString: @"." options: 0 range: r]).length == 1) while ((r = [s rangeOfString: @"." options: 0 range: r]).length == 1)
{ {
if (r.location > 0 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++; r.length++;
[s deleteCharactersInRange: r]; [s deleteCharactersInRange: r];
@ -4096,11 +4095,6 @@ static NSFileManager *fm = nil;
{ {
r.location++; r.location++;
} }
}
else
{
r.location++;
}
r.length = l - r.location; r.length = l - r.location;
} }