Repository navigation
cmp: use the larger of -i and the positional skip, like GNU - #371
Merged
Merged
Conversation
GNU cmp applies the largest of all skip values given for each file, from -i (also when repeated) and from the positional SKIP operands. Positional skips were dropped whenever -i was given, and a repeated -i kept only the last value. Fixes uutils#346
Collaborator
|
thanks for this PR! |
Contributor
Author
|
Thanks, done. Added
|
Collaborator
|
Thanks for your PR |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
GNU cmp uses the largest skip given for each file, whether it comes from
-ior from the positional SKIP operands (and also when-iis repeated). We dropped the positional skips as soon as-iwas given, and a repeated-ikept only the last value.Now the positional operands are always read (also after
--) and each file gets the max of all values. I updated the parse test that expected the old behaviour and added cases for-iwith positional skips, after--, and repeated-i. Checked the issue's example and a few combinations against GNU cmp, output matches.Fixes #346