Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grep: fix output duplication when number of matches is greater than MAX_MATCHES #1442

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Sep 29, 2024

  1. grep: fix output duplication when number of matches is greater than M…

    …AX_MATCHES
    
    When color is enable grep(1) searches for MAX_MATCHES, prints the line and then
    repeats these steps again untill all matches in the line are found. The issue
    is that every time grep(1) prints the whole line which leads to the situation
    when line is duplicated (tripled, quadruple, ...) in stdout.
    
    Bug can be reproduced with the next simple command. It prints line twice when
    only single line is expected.
    
    $ for i in $(seq 33); do echo -n "foobar"; done | ./grep --color=auto foo
    vchimishuk committed Sep 29, 2024
    Configuration menu
    Copy the full SHA
    6058dcd View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2024

  1. Configuration menu
    Copy the full SHA
    d8cdbf3 View commit details
    Browse the repository at this point in the history