]> git.ipfire.org Git - thirdparty/coreutils.git/commit
maint: refactor nl section delimiter handling
authorPádraig Brady <P@draigBrady.com>
Tue, 15 Dec 2020 01:02:32 +0000 (01:02 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 15 Dec 2020 13:17:39 +0000 (13:17 +0000)
commitb0d527fb40bd7a36ab90af891a1934daff1f3475
treeb859a9d879805cb75a05f83f4608cdcfe34c7524
parentd3126965591ca46114b426cdf4d964b189c35a23
maint: refactor nl section delimiter handling

* src/nl.c (main): Update the default delimiter characters
when passed two characters with --section-delimiter.
Avoid redundant copies for the body and footer delimiter strings,
and instead, just offset into the header string.
(check_section): Avoid redundant comparing of 2 bytes of memory
for an empty delimiter.
src/nl.c