diff options
author | Pádraig Brady <P@draigBrady.com> | 2022-12-31 17:03:39 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2022-12-31 19:01:59 +0000 |
commit | c9a21ec3173b93de4839e5ff9eddadb020431656 (patch) | |
tree | ffa75643c1d3677533127e59a635cc054a636885 /tests | |
parent | 879d2180d6b58e7a83312681fbce9a1e841c2ae4 (diff) | |
download | coreutils-c9a21ec3173b93de4839e5ff9eddadb020431656.tar.gz |
stty: fix off by one column wrapping on output
* src/stty.c (wrapf): Adjust the comparison by 1,
to account for the space we're adding.
* tests/misc/stty.sh: Add a test case.
* NEWS: Mention the fix.
Reported in https://bugs.debian.org/1027442
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/misc/stty.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/misc/stty.sh b/tests/misc/stty.sh index bcdc80e87..7abcec5af 100755 --- a/tests/misc/stty.sh +++ b/tests/misc/stty.sh @@ -89,4 +89,10 @@ returns_ 1 strace -o log2 -e ioctl stty -blahblah || fail=1 n_ioctl2=$(wc -l < log2) || framework_failure_ test "$n_ioctl1" = "$n_ioctl2" || fail=1 +# Ensure we wrap output appropriately +for W in $(seq 80 90); do + output_width=$(COLUMNS="$W" stty -a | wc -L) + test "$output_width" -le "$W" || fail=1 +done + Exit $fail |