From 929f13fdfcb537c0fa2e17cb94058ae90072bce6 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 27 Sep 2009 22:12:45 +0000 Subject: [PATCH] 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. --- term.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/term.c b/term.c index 92f381291..ca86c607c 100644 --- a/term.c +++ b/term.c @@ -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) { -- 2.40.0