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

Always use \n as line terminator in the summary printer #2805

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ltrzesniewski
Copy link
Contributor

This contributes to #2795.

I took a closer look at the issue, and I noticed the following:

$ echo hello | rg hello --no-config --count --null-data | xxd
00000000: 3100                                     1.

i.e. the summary printer outputs null bytes instead of newlines when --null-data is used. I don't think that's intentional, and it's a noticeable behavior, so this PR changes this to always output \n.

I wasn't sure if I should use CRLF or LF on Windows, but since LF is used by default unless --crlf is enabled I used LF.


I also made changes to the standard printer (not included here), which I can submit in another PR if you think it's worth it. I just need to know if you'd rather output LF or CRLF on Windows in the standard printer. Using LF is a simple change, while using CRLF requires changing lots of unit tests so they pass on Windows.

Previously, the \x00 byte would be printed when --null-data was being used.
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.

1 participant