When copying the terminal attributes to the pty, be sure not to set ONLCR.

This prevents extra carriage returns from ending up in the script output file.
This commit is contained in:
Todd C. Miller
2009-09-27 22:12:45 +00:00
parent 577fb346fd
commit 929f13fdfc

4
term.c
View File

@@ -191,6 +191,8 @@ term_copy(src, dst)
if (tcgetattr(src, &tt) != 0)
return(0);
/* Do not convert line endings from NL to NLCR. */
CRL(tt.c_oflag, ONLCR);
if (tcsetattr(dst, TCSAFLUSH, &tt) != 0)
return(0);
return(1);
@@ -249,6 +251,8 @@ term_copy(src, dst)
ioctl(src, TIOCLGET, &lb)) {
return(0);
}
/* Do not convert line endings from NL to NLCR. */
CLR(b.sg_flags, CRMOD);
if (ioctl(dst, TIOCSETP, &b) != 0 || ioctl(dst, TIOCSETC, &tc) != 0 ||
ioctl(dst, TIOCSLTC, &lc) != 0 || ioctl(dst, TIOCLSET, &lb) != 0 ||
ioctl(dst, TIOCSETD, &l) != 0) {