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: no match for empty pattern file #821

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Nov 18, 2024

  • Testing against old commit 504caa9, "grep -f empty" resulted in exit(1), i.e. no match
  • A recent commit introduced a bug where ARGV would be shifted incorrectly if an empty file was passed as argument to -f
  • Follow GNU grep and bypass the search in this case because we know there cannot be any matches
%touch empty && perl grep -f empty ar
%echo $?
1

* Testing against old commit 504caa9, "grep -f empty" was handled by exit(1), i.e. no match
* A recent commit introduced a bug where ARGV would be shifted incorrectly if an empty file was passed as argument to -f
* Follow GNU grep and bypass the search in this case because we know there cannot be any matches

%touch empty && perl grep -f empty ar
%echo $?
1
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: grep The grep program labels Nov 18, 2024
@coveralls
Copy link

coveralls commented Nov 18, 2024

Pull Request Test Coverage Report for Build 11888927757

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 73.069%

Totals Coverage Status
Change from base Build 11888199200: 0.0%
Covered Lines: 350
Relevant Lines: 479

💛 - Coveralls

@briandfoy briandfoy merged commit 822219a into briandfoy:master Nov 19, 2024
23 checks passed
@briandfoy
Copy link
Owner

changes: return no match exit code for an empty pattern file used with -f

@briandfoy briandfoy self-assigned this Nov 19, 2024
@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: grep The grep program Status: accepted The fix is accepted Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants