Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/qsubst fix a bug with terminal modes being badly set...



details:   https://anonhg.NetBSD.org/src/rev/594cf43826c9
branches:  trunk
changeset: 476039:594cf43826c9
user:      perry <perry%NetBSD.org@localhost>
date:      Sat Sep 04 18:02:58 1999 +0000

description:
fix a bug with terminal modes being badly set on exit

diffstat:

 usr.bin/qsubst/qsubst.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 213497272800 -r 594cf43826c9 usr.bin/qsubst/qsubst.c
--- a/usr.bin/qsubst/qsubst.c   Sat Sep 04 17:07:22 1999 +0000
+++ b/usr.bin/qsubst/qsubst.c   Sat Sep 04 18:02:58 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: qsubst.c,v 1.2 1999/09/04 17:07:23 perry Exp $ */
+/*     $NetBSD: qsubst.c,v 1.3 1999/09/04 18:02:58 perry Exp $ */
 
 /*
  * qsubst -- designed for renaming routines existing in a whole bunch
@@ -223,9 +223,11 @@
 static int getc_cbreak(void)
 {
  struct termios tio;
+ struct termios otio;
  char c;
 
  if (tcgetattr(0,&tio) < 0) return(getchar());
+ otio = tio;
  tio.c_lflag &= ~(ICANON|ECHOKE|ECHOE|ECHO|ECHONL);
  tio.c_cc[VMIN] = 1;
  tio.c_cc[VTIME] = 0;
@@ -238,7 +240,7 @@
     case 1:
        break;
   }
- tcsetattr(0,TCSANOW|TCSASOFT,&tio);
+ tcsetattr(0,TCSANOW|TCSASOFT,&otio);
  return(c);
 }
 



Home | Main Index | Thread Index | Old Index