]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
diff: Fix --expand-tabs and --side-by-side.
authorDag-Erling Smørgrav <des@FreeBSD.org>
Mon, 26 Feb 2024 18:08:06 +0000 (19:08 +0100)
committerDag-Erling Smørgrav <des@FreeBSD.org>
Mon, 26 Feb 2024 18:08:06 +0000 (19:08 +0100)
commit53de23f4d140becc3166e87665b0064f215a220e
tree5857277bf66bd367cd10ac57e5bd24e84f262bc6
parent6b9e6f12e5bbfe347dba8ff8e1e161f9180a1edd
diff: Fix --expand-tabs and --side-by-side.

* Overhaul column width and padding calculation.
* Rewrite print_space() so it is now a) correct and b) understandable.
* Rewrite tab expansion in fetch() for the same reason.

This brings us in line with GNU diff for all cases I could think of.

Sponsored by: Klara, Inc.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44014
usr.bin/diff/diff.1
usr.bin/diff/diff.c
usr.bin/diff/diffreg.c