mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Bugfix for #19099
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24655 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3c33db790d
commit
5add923d0f
3 changed files with 39 additions and 9 deletions
|
@ -3096,13 +3096,29 @@ static NSFileManager *fm = nil;
|
|||
/* If the 'component' has a leading path separator (or drive spec
|
||||
* in windows) then we need to find its length so we can strip it.
|
||||
*/
|
||||
if (aLength > 0 && [aString characterAtIndex: 0] != '~')
|
||||
root = rootOf(aString, aLength);
|
||||
if (root > 0)
|
||||
{
|
||||
root = rootOf(aString, aLength);
|
||||
}
|
||||
else
|
||||
{
|
||||
root = 0;
|
||||
unichar c = [aString characterAtIndex: 0];
|
||||
|
||||
if (c == '~')
|
||||
{
|
||||
root = 0;
|
||||
}
|
||||
else if (root > 1 && pathSepMember(c))
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 1; i < root; i++)
|
||||
{
|
||||
c = [aString characterAtIndex: i];
|
||||
if (!pathSepMember(c))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
root = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (length == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue