mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +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
af7f09463c
commit
baf969486b
1 changed files with 12 additions and 18 deletions
|
@ -4072,30 +4072,24 @@ 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);
|
r.length++;
|
||||||
|
[s deleteCharactersInRange: r];
|
||||||
if (pos == l)
|
l -= r.length;
|
||||||
{
|
|
||||||
[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++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue