Skip to content

handles empty-matching patterns under -w/-x differently from GNU (empty line never selected) #18

Closed

Description

@sylvestre

Reproduction

Input (/tmp/e.txt) is three lines: abc, an empty line, x
.
Rust (incorrect)

$ printf 'abc\n\nx\n' | ./target/release/grep -e '$' -w
# Output: (none)
# Exit code: 1

GNU (correct)

$ printf 'abc\n\nx\n' | LC_ALL=C /usr/bin/grep -e '$' -w
# Output: (one empty line)
# Exit code: 0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions