mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Patch by David relson
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10051 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ebba65ddcb
commit
dc1eb96e3f
2 changed files with 38 additions and 34 deletions
|
@ -1,3 +1,7 @@
|
|||
2001-06-01 Richard Frith-Macdonald <rfm@gnu.uk>
|
||||
|
||||
* Source/NSString.m: Patch by David Relson applied
|
||||
|
||||
2001-06-01 Richard Frith-Macdonald <rfm@gnu.uk>
|
||||
|
||||
Optimisations suggested by Guenther Fuerthaller
|
||||
|
|
|
@ -1782,21 +1782,23 @@ handle_printf_atsign (FILE *stream,
|
|||
}
|
||||
if (start == 0)
|
||||
{
|
||||
thischar = (*caiImp)(self, caiSel, start);
|
||||
switch (thischar)
|
||||
{
|
||||
case (unichar)0x000A:
|
||||
case (unichar)0x000D:
|
||||
case (unichar)0x2028:
|
||||
case (unichar)0x2029:
|
||||
start++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
thischar = (*caiImp)(self, caiSel, start);
|
||||
switch (thischar)
|
||||
{
|
||||
case (unichar)0x000A:
|
||||
case (unichar)0x000D:
|
||||
case (unichar)0x2028:
|
||||
case (unichar)0x2029:
|
||||
start++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
start++;
|
||||
{
|
||||
start++;
|
||||
}
|
||||
*startIndex = start;
|
||||
}
|
||||
}
|
||||
|
@ -1824,33 +1826,31 @@ handle_printf_atsign (FILE *stream,
|
|||
if (done)
|
||||
break;
|
||||
}
|
||||
if (end < len)
|
||||
if (lineEndIndex)
|
||||
{
|
||||
if ((*caiImp)(self, caiSel, end) == (unichar)0x000D)
|
||||
if (end < len
|
||||
&& ((*caiImp)(self, caiSel, end) == (unichar)0x000D)
|
||||
&& ((*caiImp)(self, caiSel, end+1) == (unichar)0x000A))
|
||||
{
|
||||
if ((*caiImp)(self, caiSel, end+1) == (unichar)0x000A)
|
||||
*lineEndIndex = end+1;
|
||||
else
|
||||
*lineEndIndex = end;
|
||||
*lineEndIndex = end+1;
|
||||
}
|
||||
else
|
||||
*lineEndIndex = end;
|
||||
{
|
||||
*lineEndIndex = end;
|
||||
}
|
||||
}
|
||||
else
|
||||
*lineEndIndex = end;
|
||||
}
|
||||
|
||||
if (contentsEndIndex)
|
||||
{
|
||||
if (end < len)
|
||||
if (contentsEndIndex)
|
||||
{
|
||||
*contentsEndIndex = end-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* xxx OPENSTEP documentation does not say what to do if last
|
||||
line is not terminated. Assume this */
|
||||
*contentsEndIndex = end;
|
||||
if (end < len)
|
||||
{
|
||||
*contentsEndIndex = end-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* xxx OPENSTEP documentation does not say what to do if last
|
||||
line is not terminated. Assume this */
|
||||
*contentsEndIndex = end;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue