Repository navigation
ls: fix --dired offsets after a directory with no listed entries - #15840
Open
Guilherme-M-Mateus wants to merge 1 commit into
Open
Guilherme-M-Mateus wants to merge 1 commit into
Guilherme-M-Mateus wants to merge 1 commit into
Conversation
After a directory that lists no entry, its heading and "total" line were dropped from the --dired byte count, shifting every later offset. Fixes uutils#15800 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
GNU testsuite comparison: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15800
TextOutput::write_dir_header()resetdired.paddingto 0 before each heading after the first. When the previous directory listed no entry (empty, or only dot files without-a),paddingstill held that directory's heading andtotalline, so those bytes were lost and every later//DIRED/////SUBDIRED//offset was too small. The padding is now kept;line_offsetandpaddingare only ever used as a sum, and when the previous directory had entriespaddingis already 0, so other listings are unchanged.Added
test_ls_dired_offsets_after_empty_dir, covering several operands and-Rwith an empty and a dot-only directory. It fails before this change and passes after; alltest_lstests pass.AI-assisted (Claude Code); I reviewed the change.
🤖 Generated with Claude Code