fix range error in last substring creation change

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35940 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2013-01-08 21:59:38 +00:00
parent 6d9d73c0b4
commit fd9e1db26c
2 changed files with 20 additions and 10 deletions

View file

@ -36,7 +36,7 @@ extern "C" {
#if OS_API_VERSION(GS_API_NONE,GS_API_LATEST) #if OS_API_VERSION(GS_API_NONE,GS_API_LATEST)
/** /**
* The additionalinterface defined for GNUstep.<br /> * The additional interface defined for GNUstep.<br />
* Currently NOT implemented when using the Apple Foundation!<br /> * Currently NOT implemented when using the Apple Foundation!<br />
* Please contribute an Apple implementation. * Please contribute an Apple implementation.
*/ */
@ -63,7 +63,7 @@ extern "C" {
/** /**
* GSServerStream is a subclass of NSStream that encapsulate a "server" * GSServerStream is a subclass of NSStream that encapsulate a "server"
* stream; * that is a stream that binds to a socket and accepts incoming * stream; that is a stream that binds to a socket and accepts incoming
* connections.<br /> * connections.<br />
* Currently NOT implemented when using the Apple Foundation!<br /> * Currently NOT implemented when using the Apple Foundation!<br />
* Please contribute an Apple implementation. * Please contribute an Apple implementation.
@ -71,32 +71,40 @@ extern "C" {
@interface GSServerStream : NSStream @interface GSServerStream : NSStream
/** /**
* Createe a ip (ipv6) server stream * Create an IP (ipv4 or ipv6) server stream.<br />
* The addr argument must be a string object containing a standard text
* representation of an internet address (either the dot separated ipv4
* syntax or the colon separated ipv6 syntax).
*/ */
+ (id) serverStreamToAddr: (NSString*)addr port: (NSInteger)port; + (id) serverStreamToAddr: (NSString*)addr port: (NSInteger)port;
/** /**
* Create a local (unix domain or named pipe) server stream * Create a local (unix domain or named pipe) server stream.
*/ */
+ (id) serverStreamToAddr: (NSString*)addr; + (id) serverStreamToAddr: (NSString*)addr;
/** /**
* This is the method that accepts a connection and generates two streams * This is the method that accepts a connection and generates two streams
* as the server side inputStream and OutputStream. * as the server side inputStream and OutputStream.<br />
* Although you still need to open them, the open will be * You call this when you receive an event on the server stream signalling
* instantanious, and no NSStreamEventOpenCompleted event will be delivered. * that it is 'readable' (bytes available).<br />
* Although you still need to open them, the open will be instantaneous,
* and no NSStreamEventOpenCompleted event will be delivered.
*/ */
- (void) acceptWithInputStream: (NSInputStream **)inputStream - (void) acceptWithInputStream: (NSInputStream **)inputStream
outputStream: (NSOutputStream **)outputStream; outputStream: (NSOutputStream **)outputStream;
/** /**
* the designated initializer for a ip (ipv6) server stream * The designated initializer for an IP (ipv4 or ipv6) server stream.<br />
* The addr argument must be a string object containing a standard text
* representation of an internet address (either the dot separated ipv4
* syntax or the colon separated ipv6 syntax).
*/ */
- (id) initToAddr: (NSString*)addr port: (NSInteger)port; - (id) initToAddr: (NSString*)addr port: (NSInteger)port;
/** /**
* the designated initializer for a local (unix domain or named pipe) * The designated initializer for a local (unix domain or named pipe)
* server stream * server stream.
*/ */
- (id) initToAddr: (NSString*)addr; - (id) initToAddr: (NSString*)addr;

View file

@ -3855,6 +3855,7 @@ agree, create a new GSCInlineString otherwise.
s = createTinyString((char*)_contents.c + aRange.location, aRange.length); s = createTinyString((char*)_contents.c + aRange.location, aRange.length);
if (nil == s) if (nil == s)
{ {
aRange.location += (_contents.c - _parent->_contents.c);
s = substring_c((GSStr)_parent, aRange); s = substring_c((GSStr)_parent, aRange);
} }
return s; return s;
@ -3868,6 +3869,7 @@ agree, create a new GSCInlineString otherwise.
s = createTinyString((char*)_contents.c + aRange.location, aRange.length); s = createTinyString((char*)_contents.c + aRange.location, aRange.length);
if (nil == s) if (nil == s)
{ {
aRange.location += (_contents.c - _parent->_contents.c);
s = substring_c((GSStr)_parent, aRange); s = substring_c((GSStr)_parent, aRange);
} }
return s; return s;