Repository navigation
Conversation
- Fix a bug where hex revert (`-r`) would stop prematurely on files with CRLF line endings. - Fix missing padding in the hex area for little-endian output (`-e`) on partial last lines. - Remove redundant `int e` argument from several hex output functions as it was immediately overwritten by `getc_or_die`. - Correct `max_idx` calculation in `hex_littleendian` to prevent the newline from overwriting ASCII characters. Co-authored-by: xyproto <52813+xyproto@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
I don't think this is trustworthy. Will need to add tests for this first. |
I've added formal tests to the |
- Added `test_revert_crlf` to verify that hex revert handles CRLF line endings. - Added `test_le_padding` to verify that little-endian output correctly pads partial lines. - Included these new tests in the main `test` target. Co-authored-by: xyproto <52813+xyproto@users.noreply.github.com>
|
Removing the |
Actually, removing this check makes |
- Added formal regression tests to the Makefile. - Verified that removing the CRLF check aligns better with reference xxd behavior. Co-authored-by: xyproto <52813+xyproto@users.noreply.github.com>
I have fixed two major bugs and performed some code cleanup in
main.c.CRLF Hex Revert Bug: The hex revert logic was incorrectly stopping whenever it encountered a
\rcharacter. This meant that on Windows-style hex dumps (with CRLF), only the first line would be processed. I removed the&& c != '\r'condition from thewhileloops indecode_hex_stream_normalanddecode_hex_stream_bitsto allow processing to continue.Little-Endian Padding Bug: In little-endian mode (
-e), the hex area was not being properly padded with spaces when the last line was partial and color was disabled. This caused the ASCII column to be misaligned. I added a loop to correctly pad the hex area, using the appropriate XOR-based byte order calculation. I also fixed an issue where the newline was incorrectly overwriting ASCII characters in some cases due to impropermax_idxupdates.Code Cleanup: I removed the redundant
int eparameter from several functions (hex_postscript,hex_cinclude, etc.) because it was being overwritten by a localgetc_or_diecall anyway.All changes have been verified with
make testand new reproduction test cases.PR created automatically by Jules for task 4771549755149731832 started by @xyproto