Expand description
Line-ending-agnostic comparison helpers.
Preset templates are embedded and written LF (see the repo .gitattributes),
but a user’s on-disk copy of an installed file may be CRLF — e.g. a Windows
editor re-saving a PowerShell profile. Comparing those byte-exact would treat
a pure CRLF↔LF difference as a real change, producing spurious “update”
reports (and silent whole-file rewrites) on re-install. These helpers let the
reconciliation logic compare content while ignoring line-ending style.
Functions§
- eol_eq
- Compares two byte slices for equality, ignoring line-ending style
(
\r\n, lone\r, and\nare all treated as equivalent line breaks). - normalize_
eol - Returns a copy of
byteswith every\r\nand lone\rreduced to\n.