-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Is --null-data expected to behave like --null when printing file path? #1289
Comments
Interesting! Thanks for filing this. The problem here is that when ripgrep prints file headings (instead of the full file path for each matching line), it needs to print a new line after the file path. Currently, the new line character used for that is the newline character set by the end user. In this case, the I wonder what the correct behavior should be. The current behavior is indeed surprising, but consistent. Is the correct behavior to just assume |
Personally, I don't have a use case, so I don't have a preference and this could just be added to manual as a note. Couple of points to consider:
For reference, as far as I've noticed, GNU grep uses |
I also experienced the similar issue - with Changing the input data as null-terminated not just mean an I/O stream of lines terminated by null. It can also mean we want a textual file not to be separated into lines, so that we could use |
About the output problem I mentioned aboveI just double checked. Output without pipeline is still line-by-line, it is NOT ALWAYS garbage (or hard-to-read, I should say). I found that in the output of i.e. expected correct output:
become:
In addition, I've checked that with pipeline or not, the behavior is different. With a further
|
Info: for |
What version of ripgrep are you using?
How did you install ripgrep?
Using https://github.com/BurntSushi/ripgrep/releases/download/11.0.1/ripgrep_11.0.1_amd64.deb
What operating system are you using ripgrep on?
Ubuntu 16.04.1
Describe your question, feature request, or bug.
When
--null-data
option is used (but without using--null
) and filenames are part of output, such file paths are terminated with NUL byte, similar to what--null
does. Is this expected behavior?The text was updated successfully, but these errors were encountered: