diff options
author | 2012-05-24 19:22:46 +0000 | |
---|---|---|
committer | 2012-05-24 19:22:46 +0000 | |
commit | 6dcc3a8ca79da220ca646eee5792c3abcda87330 (patch) | |
tree | 45be0fc44a79a41eeb48d74c15f8cdd38fb96e02 | |
parent | put possible fragments in there. (diff) | |
download | wireguard-openbsd-6dcc3a8ca79da220ca646eee5792c3abcda87330.tar.xz wireguard-openbsd-6dcc3a8ca79da220ca646eee5792c3abcda87330.zip |
When clearing quote bits in getc and q_to_b, clear from the c_cf (the
first, that is being removed) rather than c_cl (the last).
ok matthew miod deraadt
-rw-r--r-- | sys/kern/tty_subr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index bc81a0fd878..81581ba0b88 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_subr.c,v 1.23 2010/11/11 17:35:23 miod Exp $ */ +/* $OpenBSD: tty_subr.c,v 1.24 2012/05/24 19:22:46 nicm Exp $ */ /* $NetBSD: tty_subr.c,v 1.13 1996/02/09 19:00:43 christos Exp $ */ /* @@ -101,7 +101,7 @@ getc(struct clist *clp) if (clp->c_cq) { if (isset(clp->c_cq, clp->c_cf - clp->c_cs) ) c |= TTY_QUOTE; - clrbit(clp->c_cq, clp->c_cl - clp->c_cs); + clrbit(clp->c_cq, clp->c_cf - clp->c_cs); } if (++clp->c_cf == clp->c_ce) clp->c_cf = clp->c_cs; @@ -134,7 +134,7 @@ q_to_b(struct clist *clp, u_char *cp, int count) bcopy(clp->c_cf, p, cc); bzero(clp->c_cf, cc); if (clp->c_cq) - clrbits(clp->c_cq, clp->c_cl - clp->c_cs, cc); + clrbits(clp->c_cq, clp->c_cf - clp->c_cs, cc); count -= cc; p += cc; clp->c_cc -= cc; |