-
Notifications
You must be signed in to change notification settings - Fork 111
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
Hexdump stops prematurely at LF #428
Comments
Here's a workaround:
The -y in the first ugrep is passthru. EDIT:
|
As you point out, the hexdump feature is line-oriented, like grep in general is a line-oriented tool. The reason is the efficient buffering with a window that shifts out at line boundaries so it is possible to quickly search several GB of input without impacting memory resources. A way to avoid this is to match newline Perhaps this should be moved to the ugrep discussion so we can close this eventually. |
Yeah I had a hunch it might be something like that. I guess only the repo owner can move to Discussions? Didn't spot any way to do that... |
I agree that there are opportunities to improve the hexdump feature with better context control. I haven't done that, because I didn't want to mess with the search engine. What I would like to do is improve the hexdump context to always show the given number of hex lines before and after a match, regardless of the presence of newlines. That needs a change to the search engine so that the before hex lines (i.e. bytes) are not shifted out of the window when searching large files. If will put that on the TODO list. |
The upcoming v7 release will produce hex before and after context lines regardless of LF boundaries. The before hex context is guaranteed to display, as long as the before hex size specified is not crazy large like hundreds of hex lines (in that case, the hex before context may get truncated by chance if the file is several MB). |
Thank you! Works like a charm from what I can see :D |
The v7.0.2 update improves hex context lines when these run into each other. I want to avoid overlap, which can be confusing. So it looks a lot cleaner in the update, at least it does to me :) |
New user here, hi :D
I've only tested ugrep for a short while, but I think I've found a bug.
To cut to the chase here's an example:
Which will give you this:
So the problem is that the output doesn't continue all the way to the context boundary, it stops at the first sight of LF (0x0a).
OK sure, greps are usually line-oriented, but imho the byte values in context shouldn't matter when dealing with the binary stuff?
Tested with v3.7.2 and v6.5.0.
Btw hexdumping is THE main attraction of ugrep for me :D
I have high hopes that ugrep will help me to replace my silly old 600+ line bash/awk script that I'm now using for dumping...
The text was updated successfully, but these errors were encountered: