grep: -F -f rejects a pattern file that contains invalid UTF-8
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 62/100
Research direction
Start by locating the code that loads patterns for fixed-string mode (-F -f), then compare its byte handling with the behavior discussed in #64 and #75. Run the issue’s commands and check the exit status and output bytes; done means uutils exits 0 and writes ff 0a for the invalid-UTF-8 pattern and input.
Written by the indexing model from the issue text.
Description
uutils decodes a pattern file as UTF-8 even when the patterns are fixed strings. GNU matches the bytes.
$ printf '\377\n' > patterns; printf '\377\n' > input
$ LC_ALL=C grep -aF -f patterns input > out.bin; status=$?
$ echo "status=$status"; od -An -tx1 out.bin
GNU grep 3.12 exits 0 and writes ff 0a. uutils reports grep: patterns: stream did not contain valid UTF-8, exits 2, and writes nothing. The result is the same with LC_ALL=C.UTF-8.
#64 and the closed #75 discuss byte and locale handling more generally.
- Dominant language
- Rust
- Stars
- 133
- Forks
- 25
- Avg merge
- 19h 49m
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uutils/grep
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
grep: context output omits group separators between filesPossibly taken @SichenLiang claimed this 16 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Dependency DashboardOpen
Difficulty 1/5 Under an hour Newbie friendliness 20/100
Maintainers usually reply within 1 day
Similar issues
-
area:ecosystem documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Chelis-Lang/chelis#3866 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
metasequoiaime/msime#8620 ·
Maintainers usually reply within 1 day
-
agent-detection macos p2 triaged
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
bug documentation sev-0
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day