git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24655 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2007-02-19 19:11:50 +00:00
parent 3c33db790d
commit 5add923d0f
3 changed files with 39 additions and 9 deletions

View file

@ -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)