Fix xml parse error

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33327 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-06-17 13:47:24 +00:00
parent 3ea06f1379
commit 9212d01480
4 changed files with 45 additions and 0 deletions

View file

@ -657,6 +657,34 @@ static NSUInteger urlAlign;
return self;
}
- (id) initFileURLWithPath: (NSString*)aPath isDirectory: (BOOL)isDir
{
NSFileManager *mgr = [NSFileManager defaultManager];
BOOL flag = NO;
if ([aPath isAbsolutePath] == NO)
{
aPath = [[mgr currentDirectoryPath]
stringByAppendingPathComponent: aPath];
}
if ([mgr fileExistsAtPath: aPath isDirectory: &flag] == YES)
{
if ([aPath isAbsolutePath] == NO)
{
aPath = [aPath stringByStandardizingPath];
}
isDir = flag;
}
if (isDir == YES && [aPath hasSuffix: @"/"] == NO)
{
aPath = [aPath stringByAppendingString: @"/"];
}
self = [self initWithScheme: NSURLFileScheme
host: @"localhost"
path: aPath];
return self;
}
- (id) initWithScheme: (NSString*)aScheme
host: (NSString*)aHost
path: (NSString*)aPath