You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
head, tail: reject invalid count values even when overridden - #16038
GNU validates every -c/-n value even when a later one overrides it: head -c1-3 -n1 reports invalid number of bytes: '1-3' and exits 1, while uutils only parsed the surviving value and printed the input. tail --bytes 1,2 --lines 2 had the same problem.
Change
Extract every literal -c/-n value from the raw command line (including overridden ones) in uucore, then validate each one in head and tail. Obsolete numeric syntax is left to the existing parser. Added regression tests for both commands.
System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.
⚠️1 benchmark with a significant change ran on different hardware
Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.
No successful run was found on main (fee61ff) during the generation of this report, so aea67c0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GNU validates every -c/-n value even when a later one overrides it:
head -c1-3 -n1reportsinvalid number of bytes: '1-3'and exits 1, while uutils only parsed the surviving value and printed the input.tail --bytes 1,2 --lines 2had the same problem.Change
Extract every literal -c/-n value from the raw command line (including overridden ones) in uucore, then validate each one in
headandtail. Obsolete numeric syntax is left to the existing parser. Added regression tests for both commands.Closes #15997