mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
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:
parent
3ea06f1379
commit
9212d01480
4 changed files with 45 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
2011-06-17 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSXMLParser.m: Fix error with whitespace at end of attributes.
|
||||
* Headers/GNUstepBase/NSURL+GNUstepBase.h: Add method to build a URL
|
||||
from separate components.
|
||||
* Headers/Foundation/NSURL.h: Add some OSX 10.6 methods for path
|
||||
|
|
|
@ -97,6 +97,18 @@ GS_EXPORT NSString* const NSURLFileScheme;
|
|||
*/
|
||||
- (id) initFileURLWithPath: (NSString*)aPath;
|
||||
|
||||
#if OS_API_VERSION(100500,GS_API_LATEST)
|
||||
/**
|
||||
* Initialise as a file URL with the specified path (which must
|
||||
* be a valid path on the local filesystem).<br />
|
||||
* Converts relative paths to absolute ones.<br />
|
||||
* Appends a trailing slash to the path when necessary if it
|
||||
* specifies a directory.<br />
|
||||
* Calls -initWithScheme:host:path:
|
||||
*/
|
||||
- (id) initFileURLWithPath: (NSString*)aPath isDirectory: (BOOL)isDir;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Initialise by building a URL string from the supplied parameters
|
||||
* and calling -initWithString:relativeToURL:<br />
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1903,6 +1903,10 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes);
|
|||
[attributes setObject: val forKey: arg];
|
||||
[val release];
|
||||
c = cget(); // get character behind qarg value
|
||||
while (isspace(c))
|
||||
{
|
||||
c = cget();
|
||||
}
|
||||
}
|
||||
else // implicit
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue