summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartijn <martijn@openbsd.org>2018-07-11 06:57:18 +0000
committermartijn <martijn@openbsd.org>2018-07-11 06:57:18 +0000
commit69cbdd2da7e45bef00738bfa37bd6fc9b8c9bb8d (patch)
tree4912389252f875a9580080766df87744309af183
parentHelper function to shorten history. (diff)
downloadwireguard-openbsd-69cbdd2da7e45bef00738bfa37bd6fc9b8c9bb8d.tar.xz
wireguard-openbsd-69cbdd2da7e45bef00738bfa37bd6fc9b8c9bb8d.zip
Make the output of the list command more sensible for the output device.
We now output $COLUMNS - 8 characters of the string and a newline. This is similar to the behaviour in ed(1). Discussed with and OK schwarze@
-rw-r--r--usr.bin/sed/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 3ddc5e7a7a1..2ef2ec1013f 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.36 2017/12/13 16:06:34 millert Exp $ */
+/* $OpenBSD: main.c,v 1.37 2018/07/11 06:57:18 martijn Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -160,6 +160,10 @@ main(int argc, char *argv[])
termwidth = win.ws_col;
if (termwidth == 0)
termwidth = 80;
+ if (termwidth <= 8)
+ termwidth = 1;
+ else
+ termwidth -= 8;
if (inplace != NULL) {
if (pledge("stdio rpath wpath cpath fattr chown", NULL) == -1)