[Toybox] [BUG] The sort cmdline fails to sort by 3rd, 4th, etc column when the key_separator is not space

Rob Landley rob at landley.net
Mon Dec 26 10:35:45 PST 2016


On 12/25/2016 02:49 AM, 王小建 wrote:
> Fix a bug for sort.
> 
> When the key_separator is not space, the sort commandline tool fails to sort by the 3rd,4th,etc column.
> For example:
> 	when you exec
> 
> 	  $ sort -t',' -k 3n
> 
> 	on a file which cotains:
> 
> 	1,2,3,4
> 	2,3,4,1
> 	4,1,2,3
> 	3,4,1,2
> 
> 	you got:
> 
> 	4,1,2,3
> 	1,2,3,4
> 	2,3,4,1
> 	3,4,1,2
> 
> 	but the expected output should be:
> 
> 	3,4,1,2
> 	4,1,2,3
> 	1,2,3,4
> 	2,3,4,1

Applied, I think? (The pull request had two patches in it, which was
weird. I fished out the one where the indentation made more sense)

I added the above test to the test suite while I was at it.

Thanks,

Rob



More information about the Toybox mailing list