You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/09/30 14:36:21 UTC
DO NOT REPLY [Bug 23514] New: -
FormatterToText::characters LF to CRLF replace (Win32)
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23514>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23514
FormatterToText::characters LF to CRLF replace (Win32)
Summary: FormatterToText::characters LF to CRLF replace (Win32)
Product: XalanC
Version: 1.6
Platform: PC
OS/Version: Other
Status: NEW
Severity: Minor
Priority: Other
Component: XalanC
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: ts@edvwl.de
void
FormatterToText::characters(
const XMLCh* const chars,
const unsigned int length)
{
.....
near line 225 the if clause checks for CR _AFTER_ LF:
// Normalize LF to CR/LF...
if (chars[i] == XalanUnicode::charLF &&
(i + 1 < length &&
chars[i + 1] == XalanUnicode::charCR ))
{
m_writer->write(m_newlineString, 0, m_newlineStringLength);
++i;
}
else
{
......
}
.....
}
correct version, to do a quick check only for LF replacement:
// Normalize LF to CR/LF...
if (chars[i] == XalanUnicode::charLF )
{
}
perhaps the author of the code wants to check if their is a CR _BEFORE_ the LF
(CR/LF):
// Normalize LF to CR/LF...
if (chars[i] == XalanUnicode::charLF &&
( !i || chars[i-1] != XalanUnicode::charCR ) )
{
}
so long
Tobias