apply Wolfgangs fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33238 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2011-06-03 06:02:18 +00:00
parent ad9905a172
commit 5bb50a3205
3 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2011-06-03 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSString.m: [(-getLineStart:end:contentsEnd:forRange:)]
Fix off-by-one error iun reported contents end for DOS style lines.
2011-06-02 Riccardo Mottola <rm@gnu.org>
* Source/NSTimeZone.m: Disable use of tzname on OpenBSD too.

View file

@ -263,7 +263,7 @@ extern "C" {
/**
* Invokes -performSelectorOnMainThread:withObject:waitUntilDone:modes:
* using the supplied arguments and an array containing common modes.<br />
* These modes consist of NSRunLoopMode, NSConnectionreplyMode, and if
* These modes consist of NSRunLoopMode, NSConnectionReplyMode, and if
* in an application, the NSApplication modes.
*/
- (void) performSelectorOnMainThread: (SEL)aSelector

View file

@ -2450,6 +2450,13 @@ handle_printf_atsign (FILE *stream,
GS_RANGE_CHECK(aRange, len);
caiImp = (unichar (*)())[self methodForSelector: caiSel];
/* Place aRange.location at the beginning of a CR-LF sequence */
if (aRange.location > 0 && aRange.location < len
&& (*caiImp)(self, caiSel, aRange.location - 1) == (unichar)'\r'
&& (*caiImp)(self, caiSel, aRange.location) == (unichar)'\n')
{
aRange.location--;
}
start = aRange.location;
if (startIndex)
@ -2537,7 +2544,7 @@ handle_printf_atsign (FILE *stream,
&& ((*caiImp)(self, caiSel, end-1) == (unichar)0x000D)
&& ((*caiImp)(self, caiSel, end) == (unichar)0x000A))
{
*lineEndIndex = end+1;
*lineEndIndex = ++end;
termlen = 2;
}
else