Read in text mode, write in binary mode on OS/2

This enables to convert CR+LF to LF when reading, but disables to
convert LF to CR+LF when writing.

Instead, however, CR+LF are not passed into mksh as is.
This commit is contained in:
KO Myung-Hun
2015-05-16 13:20:53 +09:00
parent a3fdbc6802
commit 5127457319
5 changed files with 20 additions and 0 deletions

3
exec.c
View File

@ -901,6 +901,9 @@ scriptexec(struct op *tp, const char **ap)
unsigned short m;
ssize_t n;
#ifdef __OS2__
setmode(fd, O_TEXT);
#endif
/* read first couple of octets from file */
n = read(fd, buf, sizeof(buf) - 1);
close(fd);