Skip to content

Commit 7598fdf

Browse files
committed
avoid DEBUG duplicate newline
1 parent 3e5e07e commit 7598fdf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/fileio.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,16 @@ void TIDY_CALL TY_(filesink_putByte)( void* sinkData, byte bv )
8787
fputc( bv, fout );
8888
#if !defined(NDEBUG) && defined(_MSC_VER)
8989
if (_fileno(fout) != 2)
90-
SPRTF("%c",bv);
90+
{
91+
if (bv != 0x0d)
92+
{
93+
/*\
94+
* avoid duplicate newline - SPRTF will translate an 0x0d to CRLF,
95+
* and do the same with the following 0x0a
96+
\*/
97+
SPRTF("%c",bv);
98+
}
99+
}
91100
#endif
92101
}
93102

0 commit comments

Comments
 (0)