Read in text mode in a needed place only

Converting CR+LF to LF in blocking_read() which is a underlying read
function, may affect to the functions which do not perform line-based
operation.

    modified:   funcs.c
    modified:   main.c
    modified:   misc.c
    modified:   os2.c
    modified:   shf.c
This commit is contained in:
KO Myung-Hun
2016-12-17 17:04:37 +09:00
parent 18ff277047
commit 20dbf6b45b
5 changed files with 31 additions and 11 deletions

3
os2.c
View File

@ -191,7 +191,8 @@ void os2_init(int *argcp, const char ***argvp)
init_extlibpath();
env_slashify();
setmode(STDIN_FILENO, O_TEXT);
if (!isatty(STDIN_FILENO))
setmode(STDIN_FILENO, O_BINARY);
if (!isatty(STDOUT_FILENO))
setmode(STDOUT_FILENO, O_BINARY);
if (!isatty(STDERR_FILENO))