Example for the DOS rtlib:
'' The DOS rtlib uses fwrite(stdout) to 'print' stuff when stdout '' is redirected (fb_ConsolePrintBufferEx_STDIO), and the result is '' a\r\r\n instead of a\r\n, because fwrite() replaces \n by \r\n, '' because stdout is opened in text mode, not binary. print !"a\r\n"; '' The same happens with the rtlib's own \r\n (FB_NEWLINE), '' which it adds behind normal print's. print "a"
The same happens on Win32 with Open Cons, at least if redirected to a file:
open cons for output as #1 print #1, "foo" close #1
This is probably caused by Open Cons using fb_DevFileWrite() -> fwrite() on stdout.
Maybe the rtlib should have a flag on its internal file handles that tells the Print code whether to use \n or \r\n.