Zack Weinberg wrote:
Is there a reason not to set stdin/stdout to binary at the
beginning of execution and leave them that way forever?
Sure is. When text mode is set, stdout prepends every "\n" with a
"\r". That means printf("mtn: usage\n") gets turned into "mtn:
usage\r\n" when it hits the console. Naked "\n"s looks okay in the
console, but if you redirect it into a file then open in an editor
that's dumb about newlines (like, say, the "notepad" that comes with
Windows) it looks awful. Best to stick with the local EOL convention.
That reminds me. Does the conversion step with get_linesep_conv()
happen with "mtn cat"? I think it does not, but it should.
larry
|