From: martijn Date: Wed, 11 Jul 2018 06:57:18 +0000 (+0000) Subject: Make the output of the list command more sensible for the output device. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=69cbdd2da7e45bef00738bfa37bd6fc9b8c9bb8d;p=openbsd 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@ --- 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)