mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
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:
parent
98fbc66b1c
commit
456b2a7d49
1 changed files with 12 additions and 18 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue