Issue #383 - Output message file text byte-by-byte
This commit is contained in:
parent
98f32ddebb
commit
e6f1533d89
|
@ -260,30 +260,32 @@ static void messagePos( TidyDocImpl* doc, TidyReportLevel level, uint code,
|
||||||
if ( go )
|
if ( go )
|
||||||
{
|
{
|
||||||
enum { sizeBuf=1024 };
|
enum { sizeBuf=1024 };
|
||||||
char *buf = TidyDocAlloc(doc,sizeBuf);
|
TidyOutputSink *outp = &doc->errout->sink;
|
||||||
|
char *buf = (char *)TidyDocAlloc(doc,sizeBuf);
|
||||||
const char *cp;
|
const char *cp;
|
||||||
|
byte b;
|
||||||
if ( line > 0 && col > 0 )
|
if ( line > 0 && col > 0 )
|
||||||
{
|
{
|
||||||
ReportPosition(doc, line, col, buf, sizeBuf);
|
ReportPosition(doc, line, col, buf, sizeBuf);
|
||||||
#if !defined(NDEBUG) && defined(_MSC_VER)
|
|
||||||
SPRTF("%s",buf);
|
|
||||||
#endif
|
|
||||||
for ( cp = buf; *cp; ++cp )
|
for ( cp = buf; *cp; ++cp )
|
||||||
TY_(WriteChar)( *cp, doc->errout );
|
{
|
||||||
|
b = (*cp & 0xff);
|
||||||
|
outp->putByte( outp->sinkData, b );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LevelPrefix( level, buf, sizeBuf );
|
LevelPrefix( level, buf, sizeBuf );
|
||||||
#if !defined(NDEBUG) && defined(_MSC_VER)
|
|
||||||
SPRTF("%s",buf);
|
|
||||||
SPRTF("%s\n",messageBuf);
|
|
||||||
#else
|
|
||||||
for ( cp = buf; *cp; ++cp )
|
for ( cp = buf; *cp; ++cp )
|
||||||
TY_(WriteChar)( *cp, doc->errout );
|
{
|
||||||
|
b = (*cp & 0xff);
|
||||||
|
outp->putByte( outp->sinkData, b );
|
||||||
|
}
|
||||||
for ( cp = messageBuf; *cp; ++cp )
|
for ( cp = messageBuf; *cp; ++cp )
|
||||||
TY_(WriteChar)( *cp, doc->errout );
|
{
|
||||||
|
b = (*cp & 0xff);
|
||||||
|
outp->putByte( outp->sinkData, b );
|
||||||
|
}
|
||||||
TY_(WriteChar)( '\n', doc->errout );
|
TY_(WriteChar)( '\n', doc->errout );
|
||||||
#endif
|
|
||||||
TidyDocFree(doc, buf);
|
TidyDocFree(doc, buf);
|
||||||
}
|
}
|
||||||
TidyDocFree(doc, messageBuf);
|
TidyDocFree(doc, messageBuf);
|
||||||
|
|
Loading…
Reference in a new issue