summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2020-07-22 17:39:51 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2020-07-22 17:39:51 +0000
commit5831a17918a231b6d2672e97629e55cb62e6327f (patch)
treefaa98065a0f81b1b3be5c2403b717b430ce10ee5 /sys
parentd4e0381e105e4d76b4733d29356899a89865a8da (diff)
pstat -t was showing bogus column data on ttys, in modes where
newline doesn't occur to rewind to column 0. If OPOST is inactive, simply return 0. ok millert
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/tty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index e747a4f3035..9975c349e8b 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.162 2020/07/20 18:42:30 deraadt Exp $ */
+/* $OpenBSD: tty.c,v 1.163 2020/07/22 17:39:50 deraadt Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -2408,7 +2408,8 @@ ttystats_init(struct itty **ttystats, int *ttycp, size_t *ttystatssiz)
itp->t_outq_c_cc = tp->t_outq.c_cc;
itp->t_hiwat = tp->t_hiwat;
itp->t_lowat = tp->t_lowat;
- itp->t_column = tp->t_column;
+ if (ISSET(tp->t_oflag, OPOST))
+ itp->t_column = tp->t_column;
itp->t_state = tp->t_state;
itp->t_session = tp->t_session;
if (tp->t_pgrp)