Repository navigation
main: don't parse the -r repeat count again as a -c option - #375
Merged
Merged
Conversation
after reading c<N> from "-r1c2" nothing is left in the argument, but the code only checks for the m<fmt> mark, so it rewinds to just after the time and "c2" gets parsed as "-c 2". that selects commands starting with "2" insted of limiting the repeats. stop when the argument is used up. the repeat test only counted the ======= markers, wich still come out right, so also check that the process gets listed.
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.
-rwith a count also turns the count into a-ccommand filter, so you get the right number of repeats but nothing in them:after
c<N>is read there's nothing left in the argument, but the code only checks for themmark, so it rewinds andc2gets parsed again as-c 2. without-athe bug is easier to miss since-pstill selects the process.the fix stops when the argument is used up.
case-20-repeat-count.bashonly counted the=======lines wich is why it passed, so i extended it to check the process is listed. it fails before and passes after, andmake checkis clean on linux.