You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sort -h misorders negative sizes: the sign is dropped from the comparison (-500M < -2G < -1G instead of -2G < -1G < -500M) #1371
WinuxCmd appears to compare unit first and magnitude ignoring the sign (within a unit, the larger absolute value sorts first), so any set of negative human-readable sizes comes out wrong.
Expected (GNU)
-h compares the full signed quantity: sign, then scaled magnitude.
Source
src/commands/sort.cpp: the human-numeric comparator (human_size_compare-style path) drops the sign before comparing scaled values.
Regression seed
In-repo test named with this issue number: the fixture above plus a mixed-sign set (-1K, 0, 2K, -3) asserted in GNU order.
Activity
fix(sort): -h compares (suffix rank, mantissa) lexicographically per …