Skip to content

truncate: interpret zero-padded sizes as decimal - #16802

Open
limadog9 wants to merge 1 commit into
uutils:mainfrom
limadog9:truncate-decimal-size-16799
Open

limadog9 wants to merge 1 commit into
uutils:mainfrom
limadog9:truncate-decimal-size-16799

Conversation

@limadog9

Copy link
Copy Markdown
Contributor

A leading zero made truncate -s '<010' cut a ten-byte file to eight bytes. This fix reads zero-padded sizes as decimal and adds regression tests for absolute and at-most sizes.

Closes #16799

@limadog9
limadog9 force-pushed the truncate-decimal-size-16799 branch from 6b74f89 to 1a81149 Compare December 1, 2026 17:25
@codspeed

codspeed Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 10.73%

1 warning, 1 note

⚠️ 112 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

ℹ️ 1 benchmark has no flamegraph

The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.

See affected benchmarks

⚡ 3 improved benchmarks
✅ 181 untouched benchmarks
⏩ 305 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ socket_addrs_direct[100000] 132.1 µs 105.5 µs +25.15%
⚡ hostname_ip_lookup[100000] 573.3 µs 545.3 µs +5.13%
⚡ ls_recursive_deep_tree[(200, 2)] 3.1 ms 3 ms +3.19%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing limadog9:truncate-decimal-size-16799 (1a81149) with main (f88b235)

Open in CodSpeed

Footnotes

  1. 305 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

This branch has not been deployed

No deployments
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.

truncate -s interprets zero-padded sizes as octal and silently cuts files below the requested limit

1 participant