Merge from 1.4.0

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14208 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2002-07-29 19:37:40 +00:00
parent 2a17d50744
commit b8e7170255
14 changed files with 260 additions and 91 deletions

View file

@ -1840,7 +1840,7 @@ handle_printf_atsign (FILE *stream,
forRange: (NSRange)aRange
{
unichar thischar;
unsigned start, end, len;
unsigned start, end, len, termlen;
unichar (*caiImp)(NSString*, SEL, unsigned int);
len = [self length];
@ -1903,10 +1903,10 @@ handle_printf_atsign (FILE *stream,
if (lineEndIndex || contentsEndIndex)
{
BOOL found = NO;
end = aRange.location + aRange.length;
while (end < len)
{
BOOL done = NO;
thischar = (*caiImp)(self, caiSel, end);
switch (thischar)
@ -1915,22 +1915,24 @@ handle_printf_atsign (FILE *stream,
case (unichar)0x000D:
case (unichar)0x2028:
case (unichar)0x2029:
done = YES;
found = YES;
break;
default:
break;
}
end++;
if (done)
if (found)
break;
}
termlen = 1;
if (lineEndIndex)
{
if (end < len
&& ((*caiImp)(self, caiSel, end) == (unichar)0x000D)
&& ((*caiImp)(self, caiSel, end+1) == (unichar)0x000A))
&& ((*caiImp)(self, caiSel, end-1) == (unichar)0x000D)
&& ((*caiImp)(self, caiSel, end) == (unichar)0x000A))
{
*lineEndIndex = end+1;
termlen = 2;
}
else
{
@ -1939,9 +1941,9 @@ handle_printf_atsign (FILE *stream,
}
if (contentsEndIndex)
{
if (end < len)
if (found)
{
*contentsEndIndex = end-1;
*contentsEndIndex = end-termlen;
}
else
{