On 03/08/10 03:29, Paul Eggert wrote: > On 07/30/10 04:06, Pádraig Brady wrote: >> Perhaps since strtold() is so heavy weight anyway, >> we could strip commas first? > > On further thought I decided that my approach was all wrong, since it > mishandled "1023K" vs "1M" in output where "K" means 1024 and "M" > means 1024*1024. So I reverted it and substituted something much like > the original, except documented to behave the way that it does.
I much prefer this. The previous version was slower while still not being general. It also introduced an unlikely edge case ambiguity with 'E' in scientific notation and when representing "Exa". So the new version now sorts the following incorrectly, while not diagnosing it: 99K 97Ki That's fine I think. ls,df,du etc. don't actually output "Mi" for powers of 1024, and just append "M" for both powers of 1000 and 1024. I.E. they produce ambiguous output anyway. Also the exact position of the unit mismatch was not pin pointed which wasn't ideal. Now other tools do output "M" and "Mi" etc. correctly, and coreutils may be changed to do this in future, but for now, further complicating the code to support this is not warranted and I agree with dropping it. cheers, Pádraig.
