summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-05-24 19:22:47 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-05-24 19:22:47 +0000
commit3a9016df2931e8e06469c9bb9f77f38f18297211 (patch)
treec20f089a44dcb6f09e90100852b90d93ad609e0c /sys
parent1b4b63213b504bd19f0d666d278eeecf39db315e (diff)
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
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/tty_subr.c6
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;