diff options
author | 2012-05-24 19:30:45 +0000 | |
---|---|---|
committer | 2012-05-24 19:30:45 +0000 | |
commit | 4462ca5804f9b6f6f134375b5111943d70d35ab6 (patch) | |
tree | 27d7ffde0f3cb3f1bf7aeb40c7dcd08d5a3275d6 /sys | |
parent | When clearing quote bits in getc and q_to_b, clear from the c_cf (the (diff) | |
download | wireguard-openbsd-4462ca5804f9b6f6f134375b5111943d70d35ab6.tar.xz wireguard-openbsd-4462ca5804f9b6f6f134375b5111943d70d35ab6.zip |
unputc should clear the character removed in the buffers like getc.
ok matthew miod deraadt
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/tty_subr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index 81581ba0b88..47adbb6d497 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_subr.c,v 1.24 2012/05/24 19:22:46 nicm Exp $ */ +/* $OpenBSD: tty_subr.c,v 1.25 2012/05/24 19:30:45 nicm Exp $ */ /* $NetBSD: tty_subr.c,v 1.13 1996/02/09 19:00:43 christos Exp $ */ /* @@ -436,9 +436,11 @@ unputc(struct clist *clp) clp->c_cc--; c = *clp->c_cl & 0xff; + *clp->c_cl = 0; if (clp->c_cq) { if (isset(clp->c_cq, clp->c_cl - clp->c_cs)) c |= TTY_QUOTE; + clrbit(clp->c_cq, clp->c_cl - clp->c_cs); } if (clp->c_cc == 0) clp->c_cf = clp->c_cl = (u_char *)0; |