]> git.ipfire.org Git - thirdparty/coreutils.git/commit
fmt: interpret -w as an inclusive maximum
authorPádraig Brady <P@draigBrady.com>
Wed, 7 Jan 2026 17:15:28 +0000 (17:15 +0000)
committerPádraig Brady <P@draigBrady.com>
Thu, 8 Jan 2026 12:08:14 +0000 (12:08 +0000)
commit30d296dcb8d52dc89edbfcbe9896285b01227212
tree3ea3cfacfcef1a79179e10838dfe67c231780085
parentb7613ac8ffd8873d7df33fad23f44a0c7526fe7c
fmt: interpret -w as an inclusive maximum

This aligns with `fold -w` and BSD `fmt` implementations.

* src/fmt.c (fmt_paragraph): Check len <= max_width.
* tests/fmt/width.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the change in behavior.
Addresses part of https://bugs.gnu.org/79497
NEWS
src/fmt.c
tests/fmt/width.sh [new file with mode: 0755]
tests/local.mk