Set stdin to text mode, and stdout/stderr to binary mode if not a console
This commit is contained in:
parent
8168ee626f
commit
29161973e3
6
os2.c
6
os2.c
@ -167,6 +167,12 @@ void os2_init(int *argcp, const char ***argvp)
|
||||
response(argcp, argvp);
|
||||
|
||||
env_slashify();
|
||||
|
||||
setmode(STDIN_FILENO, O_TEXT);
|
||||
if (!isatty(STDOUT_FILENO))
|
||||
setmode(STDOUT_FILENO, O_BINARY);
|
||||
if (!isatty(STDERR_FILENO))
|
||||
setmode(STDERR_FILENO, O_BINARY);
|
||||
}
|
||||
|
||||
/* Remove trailing dots. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user