sort: fix -kN,M handling (was including last separator into the comparison)

Testcase:

$ printf '%s\n' a/a:a a:b | sort -t: -k1,1
a:b
a/a:a

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2015-09-19 22:06:40 +02:00
parent f085344d5c
commit 8aa7cf305b
2 changed files with 16 additions and 4 deletions

View File

@@ -98,6 +98,14 @@ testing "sort with non-default leading delim 3" "sort -n -k3 -t/ input" "\
//b/1
" ""
testing "sort with non-default leading delim 4" "sort -t: -k1,1 input" "\
a:b
a/a:a
" "\
a/a:a
a:b
" ""
testing "sort -u should consider field only when discarding" "sort -u -k2 input" "\
a c
" "\