diff options
Diffstat (limited to 'sys/kern/tty_subr.c')
| -rw-r--r-- | sys/kern/tty_subr.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index fbef87fd854..a3398117df9 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_subr.c,v 1.2 1996/03/03 17:20:12 niklas Exp $ */ +/* $OpenBSD: tty_subr.c,v 1.3 1996/06/05 22:56:43 deraadt Exp $ */ /* $NetBSD: tty_subr.c,v 1.13 1996/02/09 19:00:43 christos Exp $ */ /* @@ -550,6 +550,21 @@ catq(from, to) { int c; + if (from->c_cc == 0) /* nothing to move */ + return; + + /* + * if `to' queue is empty and the queues are the same max size, + * it is more efficient to just swap the clist structures. + */ + if (to->c_cc == 0 && from->c_cn == to->c_cn) { + struct clist tmp; + + tmp = *from; + *from = *to; + *to = tmp; + } + while ((c = getc(from)) != -1) putc(c, to); } |
