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

rfc search: Use grep -R option rather than shell globbing #12

Merged
merged 1 commit into from
Jun 26, 2018

Conversation

delucks
Copy link
Contributor

@delucks delucks commented Jun 25, 2018

Hello! I enjoy using this project and have recommended it to many others. When installing it on a computer with a low bash ARG_MAX, I noticed that the search functionality was breaking with "Argument list too long". To reproduce this, install rfc on a machine with a low ARG_MAX (my test machine was 262144), then:

$ rfc sync all
$ rfc search dns
/home/delucks/bin/rfc: line 116: /usr/bin/grep: Argument list too long

This PR changes rfc to use grep -R across the entire RFC cache directory rather than doing a stock grep against every element of the RFC directory using shell globbing. This should be more robust across embedded devices and other machines with a small amount of available memory. In my manual tests, all the output of the tool has been the same before & after this change. All tests pass as well:

$ ./test/tests.sh
all 5 rfc tests passed in 0.947s.

@bfontaine bfontaine merged commit c48ba66 into bfontaine:master Jun 26, 2018
@bfontaine
Copy link
Owner

Thank you @delucks! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants